Hotspot External Login Page

Hi all,
I want to redirect login to an external server, get back an authentication form and redirect to another web page.
Now, users will get to the login page of the external server, push a submit button and a form with the correct username and password will get back to the hotspot router. I can see a successful login of users, but how do I automatically redirect to another page after the successful login?
I cannot do this on the external server, only on the hotspot router.
I use pap authentication, and the external server is on my walled-garden.
Here are my codes:
login.html:

<html>
<head>
<meta http-equiv="refresh" content="0; url=http://www.example.com/login.html">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>

alogin.html:

<html>
<head>
<meta http-equiv="refresh" content="0; url=http://www.mikrotik.com">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>

logout.html:

<html>
<head>
<meta http-equiv="refresh" content="0; url=login.html">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>

redirect.html:

<html>
<head>
<meta http-equiv="refresh" content="0; url=login.html">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>

What am i doing wrong?

Thanks

The easiest thing is to add a hidden field with name ‘dst’ and a value of the URI you want to redirect to into the form on the external server that submits back to ‘/login’ on the router. The login servlet will log the user in and evaluate the dst parameter, and send the client an HTTP 302 with that URI.

Hi,
Thanks for your replay,
I know it is the easiest way, but as I said, I cannot do this on the external server with the dst variable. It is not my server and the other company doesn’t want to do it. Can I do it on my hotspot router?
Thanks

<html>
<head>
<meta http-equiv="refresh" content="0; url=http://www.google.com">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>

I just used that in an alogin.html on a bench router running 4.10 and got redirected to Google after login, using an external server for the login page.

What version of ROS are you using? Are you sure you have all the filenames right?

Hi,

i am using ver5 beta5

yes, all files are there.

downgrade?

thanks

Give it a try. But if the downgrade fixes it please file a bug report.

Hi,
I have downgraded to 4.11. Checked and it didn’t work.
I have upgraded again to 5beta5.
I have made my own web server (Microsoft with iis 6.0)
Put this code as login.html on the web site:

<html>
<title>Hotspot login page</title>
<body>
<form name="login" action="http://router ip address/login" method="post">
<input type="text" name="user" value="ronen">
<input type="password" name="password" value="">
<input type="hidden" name="domain" value="">
<input type="hidden" name="dst" value="http://www.google.com/">
<input type="submit" name="login" value="log in">
</form>
</body>
</html>

And after a successful login, I have been redirected to the site I put on the alogin.html.
the :
didn’t make any effect. only the site on the alogin did.
The problem is with the customer login code, not with the router.
Thanks for all your help.
Can anyone submit a code for the web server login page?
Thanks again

I can’t make the ‘dst’ parameter work, either. alogin.html works fine, anything I pass in for dst via or form or even directly by going to “https://hotspot.domain.com/login?username=test&password=test&dst=http://www.yahoo.com” in a browser does not take. From the old documentation for 2.9 that should work, the new wiki documentation unfortunately doesn’t cover servlet customization.

This seems like a bug to me. Please open a case with support@mikrotik.com. If you’re not going to do that please let me know and I’ll open the case. I’m not currently using that parameter but have some plans to do so in the future.

Try the original alogin.html that redirects to $(link-redirect) together with the dst parameter in the login.html or otherwise submitted to /login.

It just occurred to me that it is probably supposed to work like that. I’ll try it tomorrow morning on a bench.

OK,

will try on sunday.

thanks

Tested. The below alogin.html works fine with a dst parameter via GET or POST.

<html>
<head>
<meta http-equiv="refresh" content="0; url=$(link-redirect)">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>

Hi,

Thanks for the help.

it is working very nice now.