Source code template for External Web Portal (Controller 3.0.5 or below)

User Application Requirement
Actualizado04-18-2019 00:57:46 AM 39686
Este artículo se aplica a: 

Suitable for EAP/Omada Controller V3.0.5 or below.

For Omada Controller V3.1.4 or above, please refer to FAQ2390.


This document outlines the requirements when establishing an external web portal server. In Omada EAP Controller, External Web Portal can only be used when the portal authentication type is External Radius Server. For how to configure External Radius Server authentication, please refer to FAQ 896 (section 4 of step 2).


The below picture depicts the workflow among the wireless client, EAP, Omada EAP controller, External Web Portal and the Radius Server. It will help you better understand the requirements of establishing an External Web Portal server.


  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’s request to the external portal page by replying a HTTP response with 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&raidusServerIp=radius_server_ip&apMac=ap_Mac&ssid=ap_ssid”. For example, 5)
  4. External web portal server should be able to get the value of the target, clientMac and radiusServerIp parameters. Then external web portal server should return a page with a form. This form will collect the information of username, password, clientMac and radiusServerIp.

For example,

<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>


<div style="display:none"><input name="radiusSvrIp" id="radiusServerIp"/> </div>


Please note that the “id” of these elements in your form should be the same as this example. The method to get the value of “username” and “password” can be defined by yourself, but the value of “cid” and “radiusServerIp” must be obtained from the Http Request’s URL.

(Step 6)

  1. Client sends HTTP GET packets with the form to http://target_ap_ip/portal/auth after submitting. (Step7)
  2. EAP communicates with radius server to verify the username and password. (Step 8 and Step 9)
  3. If the authentication is passed, i.e., Access-Accept is received from radius server, EAP will redirect client to the EAP/Omada Controller to request a built-in success page or 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/Omada Controller:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

//set up a form, method is post

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


//form content

    <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>

                     <div style="display:none"><input name="radiusSvrIp" id="radiusServerIp"/></div>


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






<script type="text/javascript">

//where to submit the form

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


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


//assign the value of parameter “clientMac” to the form element “cid”

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

//assign the value of parameter “radiusServerIp” to the form element “radiusServerIp”

document.getElementById("radiusServerIp").value = getQueryString("radiusServerIp");




function getQueryString(name) {


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


    var r =;


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





Recommend Products

SuscripciónTP-Link toma en serio su privacidad. Para obtener más detalles sobre las prácticas de privacidad de TP-Link, consulte Política de privacidad de TP-Link .

De United States?

Obtener productos, eventos y servicios para su región.