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

Suitable for EAP Controller V2.0.3 or higher 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 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 intercepts client’s HTTP request and then redirects it to the EAP controller. (Step 1 and Step 2)
  2. The EAP controller then redirects the client to external portal page by replying a HTTP response status code 302 Found to the client. (Step 3 and Step 4)
  3. Client sends HTTP GET request to external web 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. (Step 6)
  5. The wireless client’s authentication information should be POST  to http://target_ap_ip/portal/auth with parameter “username=username&password=password&clientMac=client_mac” after submit. (Step7)
  6. EAP communicates with radius server to verify the username and password. (Step 8 and Step 9)
  7. If the authentication is passed, i.e., Access-Accept is received from radius server, EAP will either redirect client to the built-in success page or to a predefined webpage according to the configuration. (Step 10)

 

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>

This Article Suits for:
EAP245 , EAP220 , EAP115
User Application Requirement | Updated 09-07-2016 03:16:48 AM