Validate IP Address while accessing the course

Use Case - allow some courses only from known internal IP Addresses

Solution -

  • create two linked microsites, and add a custom property for the course called "internalOnly"
  • set this property on all internal only courses (those need to be disallowed from outside)
  • work with EduBrite support team to add IP address based restriction to access the internal site
  • add following check to run on course player page, in the external site in v2-footer-js
if(window.location.href.indexOf("") > -1){
  if(typeof courseId != "undefined"){
    $.post("../site/", {dispatch: "getCustomPropertyVal", entityType: "COURSE", entityId: courseId, propName: "internalOnly"}, function(data){
   if(data && data.value && data.value.toLowerCase() == "true"){
      alert("Restricted course. Please access this course from");
 }, "json");