Please Help with automatic Hotspot login

I have setup a basic hotspot which works with the MT defaults. I want to use rlogin.html to automatically login a user then forward to an external page where we will collect some customer info.

I have tried several of the various methods in the forums, but when I try to the setup, the browser gets caught in a loop showing the following:

http://192.168.88.1/login?username=sayachtclub&password=sayachtclub

But it does not login the user and go to the redirect page. I have spent over 15 hours going through the forums and trying various things and I am running out of time. I need to install tomorrow. Can someone please help.

:open_mouth:

That will log the user in, if the credentials actually work. You then need to make an alogin.html that in turn redirects to the final landing page, or you need to add another GET parameter:

http://router/login?username=username&password=password&dst=http://final.landingpage.com

Again, it just cycles.

Here is my html code.

The username and password are valid, and I can use them to login before I modified the login.html on the MT.

What happens when you add the dst GET parameter?

I see the code but how and where do I put that?

I just tried the following in a lab on 4.5, and it works just fine:

[admin@MikroTik] > /ip hotspot user profile print where name=test
Flags: * - default 
 0   name="test" idle-timeout=none keepalive-timeout=2m status-autorefresh=1m shared-users=1 rate-limit="128k/128k" transparent-proxy=yes open-status-page=always advertise=no 
[admin@MikroTik] > /ip hotspot user print detail where name=test
Flags: X - disabled, D - dynamic 
 0   name="test" password="test" profile=test uptime=6d6h33m27s bytes-in=5805962 bytes-out=109979405 packets-in=73738 packets-out=89166 
[admin@MikroTik] >

Only four files in the directory. alogin.html, login.html, logout.html and redirect.html.

logout.html and redirect.html both have the same content:

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

login.html does the automatic login:

<html>
<head>
<meta http-equiv="refresh" content="0; url=login?username=test&password=test">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>

alogin.html does the redirect after the successful login, in this case to Google:

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

Again, this is working fine in the lab.

Instead of

<meta http-equiv="refresh" content="0; url=login?username=sayachtclub&password=sayachtclub">

In your HTML, use this line instead:

http://router/login?username=username&password=password&dst=http://final.landingpage.com

But what I just posted above with an alogin.html is cleaner. If you use the method in this post instead edit the login.html and add that dst GET parameter as described and delete the alogin.html completely, leaving only redirect.html, logout.html and login.html.

Those are the exact files we used. I have attached my copies.

It just loops and fails to login the user.

Login:

alogin

redirect and logout.

What do the logs say about the login failure?

They were saying that password was not chap encrypted.

I changed it to HTTP PAP and it process correctly.

Should I setup CHAP? How?

How many users can login with this username and password?

:smiley:

Just wanted to take a couple of minutes to thank all of you for your help.

Hotspot is working and forwarding to external page just fine.

Should I setup CHAP? How?

I have no idea, I do not use CHAP anywhere. I use HTTPS instead, which also protects the credentials.

How many users can login with this username and password?

That depends on the “shared user” property of the user profile that user account is linked to, as well as your license level.

fewi: Do you just grab a cheap SSL cert and throw it on the MT ?

That would work. We have a lot of equipment so we actually use a wildcard certificate - it’s fairly expensive but can be re-used since all the equipment carries the same domain name.

Hi all

Firstly thanks for the posts, it works great. However, the redirect shows up in the Browser bar and the Title bars. Which means anyone looking carefully will see the user-name and password.

Is there anyway to hide the info. I am not a web designer so don’t know HTML at all

Trial Hotspot - Error 404: Not found - 100% Solution

We edit the file (login.html) with notepad ++

1.- The first thing we do is search: link-orig-esc
2.- After we have found we select:

href=“$%28link-login-only%29?dst=$%28link-orig-esc%29&username=T-$%28mac-esc%29”

3.- And we replace it with this one:

href=“$(link-login-only)?dst=$(link-orig-esc)&username=T-$(mac-esc)”

Do not forget the quotes " " … God bless you!


TRANSLATION TO SPANISH


Trial Hotspot - Error 404: Not found - Solucion 100%

Editamos el archivo (login.html) con notepad++

1.- Lo primero que hacemos es buscar: link-orig-esc
2.- Luego que hemos encontrado seleccionamos:

href=“$%28link-login-only%29?dst=$%28link-orig-esc%29&username=T-$%28mac-esc%29”

3.- Y lo reemplazamos por este otro:

href=“$(link-login-only)?dst=$(link-orig-esc)&username=T-$(mac-esc)”

Ojo no olvidarse de las comillas " " … Dios los bendiga !!!