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