Does someone has a captive portal login form with POST action and required hidden fields example to use with VirtualSmartZone?
Thanks!
Thanks!
- 13 Posts
- 0 Reply Likes
Posted 2 years ago
Vivek Gupta, Employee
- 16 Posts
- 4 Reply Likes
Hi Cristiano,
May be you can you try this below . Replace x.x.x.x with the ZD IP address.
<html>
<head><title>Wireless Internet Service</title></head>
<body>
<br/><center><h2>Wireless Internet Service</h2>
<form action="http://x.x.x.x:9997/login">;
<table border="0" cellpadding="5" cellspacing="0" style="width: 200px;">
<tr><th>Username:</th><td><input type="text" name="username" size="20"></td></tr>
<tr><th>Password:</th><td><input type="password" name="password" size="20"></td></tr>
<tr><td align="center" colspan="2" height="23"><input type="submit" value="Login"></td></tr>
</table></form>
</body>
</html>
Regards,
Vivek Gupta
May be you can you try this below . Replace x.x.x.x with the ZD IP address.
<html>
<head><title>Wireless Internet Service</title></head>
<body>
<br/><center><h2>Wireless Internet Service</h2>
<form action="http://x.x.x.x:9997/login">;
<table border="0" cellpadding="5" cellspacing="0" style="width: 200px;">
<tr><th>Username:</th><td><input type="text" name="username" size="20"></td></tr>
<tr><th>Password:</th><td><input type="password" name="password" size="20"></td></tr>
<tr><td align="center" colspan="2" height="23"><input type="submit" value="Login"></td></tr>
</table></form>
</body>
</html>
Regards,
Vivek Gupta
- 339 Posts
- 41 Reply Likes
Hi.
If you use above code, you'll meet failure to authentication because SZ an ZD have different form code.
----------------------------------------------
<html>
<head>
<title>Wireless Internet Service</title>
<script type="text/javascript">
function get_param(name)
{
if (location.href.indexOf("?") >= 0)
{
var query=location.href.split("?")[1];
var params=query.split("&");
for (var i = 0; i < params.length; i ++) {
value_pair=params[i].split("=");
if (value_pair[0] == name)
return unescape(value_pair[1]);
}
}
return "";
}
function get_sip() {
var sip = get_param("sip");
//var sip = "172.21.144.65"; -----> if you need to static ip, write the ip here
if (sip.indexOf(":") < 0) { // IPv4 address
return sip;
} else { // IPv6 address
return '[' + sip + ']';
}
}
</script>
</head>
<body>
<center>
<h2>Wireless Internet Service for SmartZone</h2>
<script type="text/javascript">
document.write('<form method=POST action="http://' + get_sip() + ':9997/SubscriberPortal/hotspotlogin">');
document.write('<input type="hidden" name="url" value="'+get_param("url")+'" />');
document.write('<input type="hidden" name="proxy" value="'+get_param("proxy")+'" />');
document.write('<input type="hidden" name="uip" value="'+get_param("uip")+'" />');
document.write('<input type="hidden" name="client_mac" value="'+get_param("client_mac")+'" />');
</script>
Username:<input type="text" name="username">
Password:<input type="password" name="password" >
<input type="submit" value="Login">
</form>
</center>
</body>
</html>
----------------------------------------------
Above code will be parsing to controller ip automatically.
Regards.
If you use above code, you'll meet failure to authentication because SZ an ZD have different form code.
----------------------------------------------
<html>
<head>
<title>Wireless Internet Service</title>
<script type="text/javascript">
function get_param(name)
{
if (location.href.indexOf("?") >= 0)
{
var query=location.href.split("?")[1];
var params=query.split("&");
for (var i = 0; i < params.length; i ++) {
value_pair=params[i].split("=");
if (value_pair[0] == name)
return unescape(value_pair[1]);
}
}
return "";
}
function get_sip() {
var sip = get_param("sip");
//var sip = "172.21.144.65"; -----> if you need to static ip, write the ip here
if (sip.indexOf(":") < 0) { // IPv4 address
return sip;
} else { // IPv6 address
return '[' + sip + ']';
}
}
</script>
</head>
<body>
<center>
<h2>Wireless Internet Service for SmartZone</h2>
<script type="text/javascript">
document.write('<form method=POST action="http://' + get_sip() + ':9997/SubscriberPortal/hotspotlogin">');
document.write('<input type="hidden" name="url" value="'+get_param("url")+'" />');
document.write('<input type="hidden" name="proxy" value="'+get_param("proxy")+'" />');
document.write('<input type="hidden" name="uip" value="'+get_param("uip")+'" />');
document.write('<input type="hidden" name="client_mac" value="'+get_param("client_mac")+'" />');
</script>
Username:<input type="text" name="username">
Password:<input type="password" name="password" >
<input type="submit" value="Login">
</form>
</center>
</body>
</html>
----------------------------------------------
Above code will be parsing to controller ip automatically.
Regards.
- 13 Posts
- 0 Reply Likes
- 3 Posts
- 0 Reply Likes
Related Categories
-
Ruckus Indoor APs
- 1717 Conversations
- 710 Followers
Cristiano Bevilaqua