• Support
  • FAQs
  • Source code template for External Web Portal (EAP Controller 2.x)

Source code template for External Web Portal (EAP Controller 2.x)

Suitable for EAP Controller V2.0.3 or higher Controller V2.x version

 

This document outlines the requirements when establishing an external web portal server, in other words customized landing page and provides a demo. External Web Portal can only be used if the portal authentication type is External Radius Server. For how to configure External Radius Server authentication please refer to FAQ 896, to be specific, section 4 of step 2.

 

The below picture depicts the data flow among wireless client, EAP device, EAP controller and external web portal which may help you to better understand the requirements of establishing an external web portal.

  1. Wireless client is connected to the SSID of the wireless network and try to access the internet. EAP device will intercept client’s HTTP request and then redirect it to the EAP controller (step 1 and 2).
  2. The EAP controller then redirect the client to external portal page (step 3 and 4).
  3. Client will send GET request to external portal with parameter “target=target_ap_ip&clientMac=client_mac” (step 5).
  4. External web portal server should be able to intercept the target and clientMac parameter and return the web page with authentication form on it. The two <input> elements should be the same with the 4th and 5th line of the demo code. The submit URL should be http://target_ap_ip/portal/auth (Step 6);
  5. The wireless client’s authentication information will be submitted to http://target_ap_ip/portal/auth (Step6).

 

The below html template is a simple demo for you to develop your External Web Portal working with EAP Controller:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<form id="form" method="post">

    <div><span>username:</span><input type="text" name="username"/> </div>

    <div><span>password:</span><input type="password" name="password"/></div>

      <div style="display:none"><span>clientMac:</span><input type="text" id="cid" name="clientMac" /></div>

      <button type="submit">submit</button>

</form>

 

<script type="text/javascript">

var submitUrl = "http://" + getQueryString("target") + "/portal/auth";

document.getElementById("form").action = submitUrl;

document.getElementById("cid").value = getQueryString("clientMac");

 

function getQueryString(name) {

    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");

    var r = window.location.search.substr(1).match(reg);

    if (r != null) return unescape(r[2]); return null;

}

</script>