Page 1 of 1

Hotspot splashpage / captive portal without auth

Posted: Wed May 12, 2010 5:39 pm
by ciphercore
I am looking to setup a free access hotspot. I need to have a "landing" page, that every user that connects to the hotspot will be re-directed to when accessing http. It will show info on who is providing the free access and so on.

I have setup a few other hotspots with mikrotik using the userman.

Re: Hotspot splashpage / captive portal without auth

Posted: Wed May 12, 2010 5:51 pm
by fewi
That's much simpler than you think.
First, create a user profile and a local user that is linked to the profile. The below assumes a username of 'username' and a password of 'password'.

Then make the following login.html:
<html>
<head>
<meta http-equiv="refresh" content="0; url=login?username=username&password=password">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>
That login.html is loaded for unauthorized users and usually has the login form, the above instead after 0 seconds causes an automatic redirect (HTTP code 302) to the login servlet of the Hotspot, passing on the correct user credentials and effectively logging the user in.

To cover all possible redirect conditions, create the following redirect.html and logout.html (they both get the same HTML) to in turn redirect to the above login.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>
After a successful login, alogin.html is loaded for the user. The below assumes that the page you want to show after login resides on an external server. If you want to host it on the router itself, just replace it with the HTML for the final landing screen.
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://my.external.server.com/landingpage.html">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>

Re: Hotspot splashpage / captive portal without auth

Posted: Wed May 12, 2010 6:15 pm
by ciphercore
Awesome fewi. That should be pretty easy. I'm going to try it out right now.

Re: Hotspot splashpage / captive portal without auth

Posted: Wed May 12, 2010 6:18 pm
by someuser
Very clearly written fewi, U da man.
I've got same planned scenario as this guy
After struggling through a little html and UserMan... and now... I get it.
Thanks :)
noob wanna be

Re: Hotspot splashpage / captive portal without auth

Posted: Thu May 13, 2010 9:40 pm
by ciphercore
fewi: This works great. Exactly what I was looking for.

I do have another quick question. I will be running a RB750G as the wifi access controller/captive portal. It comes with a L4 License.
Since I am not using userman/radius... this is not considered an "Active User Manager session" (20 in L4 ROS) ?, but falls under "Hotspot Active Users" (200 L4 ROS) ?

Re: Hotspot splashpage / captive portal without auth

Posted: Thu May 13, 2010 9:51 pm
by fewi
That is correct.

Edit: and while User Manager is essentially a RADIUS server, the license level for those sessions is specific to a local install of User Manager and not a general limitation on RADIUS authentication. Meaning that if you were to use a local User Manager you'd have a limit of 20 active sessions, but if you were to use an external RADIUS server (such as FreeRADIUS or even a second device with User Manager) you'd have a limit of 200 active sessions.

Re: Hotspot splashpage / captive portal without auth

Posted: Thu May 13, 2010 10:04 pm
by ciphercore
Hmmm... thanks for the extra info regarding external RADIUS. That may come in handy down the road for another project.

Re: Hotspot splashpage / captive portal without auth

Posted: Wed May 19, 2010 10:53 pm
by wispsupporttech
Thanks for this great information. I have been looking for a simple way to do this. I've implemented this as shown, but when I go to open up my browser (Chrome, Firefox, and IE), it brings up the following url:

http://192.168.4.1/login?username=user& ... d=password
(My user I created has the name user instead of username)

However, the page then starts refreshing over and over very quickly until I stop it. I'm guessing that it's not passing the information correctly to the servlet, but I don't know what I've done wrong. I copied and pasted the code directly and only changed the username variable. I'm just wondering if anyone else had this problem when implementing it.

Thanks.

Re: Hotspot splashpage / captive portal without auth

Posted: Thu May 20, 2010 4:15 pm
by fewi
Make sure you have HTTP PAP enabled on the Hotspot Server Profile (or ideally HTTPS), or change things to support CHAP. I don't use CHAP (I use HTTPS everywhere), so I have no experience with it.

Re: Hotspot splashpage / captive portal without auth

Posted: Thu May 20, 2010 7:03 pm
by wispsupporttech
Thanks a lot fewi!! Enabling PAP let me right on! :D

Re: Hotspot splashpage / captive portal without auth

Posted: Wed May 26, 2010 9:44 pm
by Coins
Hello Guys;
I have the same problem too. I need to implement my mikrotik to work with my AP which is presently working on Mac Filtering to authenticate clients through Aradial Radius server. I need to get the details from the scratch. This is the idea for the intended setup; The AP is configured to work on Mac Filtering and the clients needs to be authenticated through a login page before being routed to internet. i need your guide to setup a login page i can then modify to contain my logo. After setting up the login html , i also need a guide on how to load the Html file and setup the mikrotik to work effectively with it. Thanks

Re: Hotspot splashpage / captive portal without auth

Posted: Wed Jun 02, 2010 6:47 am
by acidu
That is correct.

Edit: and while User Manager is essentially a RADIUS server, the license level for those sessions is specific to a local install of User Manager and not a general limitation on RADIUS authentication. Meaning that if you were to use a local User Manager you'd have a limit of 20 active sessions, but if you were to use an external RADIUS server (such as FreeRADIUS or even a second device with User Manager) you'd have a limit of 200 active sessions.

hi, when refering to a secound device to use it as a radius server aka-user manager, that might be even another rb750 with L4 license, to get over that 20 active sesions?
thx

Adrian C.

Re: Hotspot splashpage / captive portal without auth

Posted: Thu Jun 03, 2010 3:53 pm
by fewi
RB750s come with an L4 license, which means 20 users.

Re: Hotspot splashpage / captive portal without auth

Posted: Wed Sep 25, 2013 6:35 pm
by franhirs
I have applied your method. It works on the first ime. Subsequent access does not go to the splash page and connects directly. Any clues ?

Re: Hotspot splashpage / captive portal without auth

Posted: Wed Sep 25, 2013 11:35 pm
by Feklar
I have applied your method. It works on the first ime. Subsequent access does not go to the splash page and connects directly. Any clues ?
Have the guests signed out first (if not try setting the idle timeout), or have you enabled login by cookies (if so, try disabling them)?

Re: Hotspot splashpage / captive portal without auth

Posted: Sat Feb 15, 2014 6:24 pm
by Maggiore81
Hello.
I have another idea:

instead than refreshing the page and auto-inserting the username/password combination, can we do a button that (as nodogsplash) clicking on it gives the MT the username/password combination?

So the user reads the page and clicks CONNECT (that login on the network).

Anyone has tested that?

Re: Hotspot splashpage / captive portal without auth

Posted: Thu Dec 04, 2014 9:12 am
by Maggiore81
up...

Re: Hotspot splashpage / captive portal without auth

Posted: Thu Dec 04, 2014 7:46 pm
by Feklar
Yes that works properly. We use that for many of the locations that we support with Hotspots since it removes the fat fingering of people connecting to the network.

Here is some of the HTML to get you started.
<input type="hidden" name="username" value="<NAME>" />
<input type="hidden" name="password" id="password" value="<Password>" />
<button type="submit" class="btn">Connect Now</button>

Re: Hotspot splashpage / captive portal without auth

Posted: Fri Jan 30, 2015 7:26 pm
by Maggiore81
It doesnt work!

I tried to use the button you provided but... maybe I set something wrong

Re: Hotspot splashpage / captive portal without auth

Posted: Sun Sep 20, 2015 6:23 pm
by Lordi
Hii there,

old thread but the button solutions is what i need now.

anynone have exsample code?

Tnx for helping

Re: Hotspot splashpage / captive portal without auth

Posted: Tue Dec 29, 2015 4:40 pm
by ALX1S
Hi, I made exactly what you told, but when I try to go to some page, start loading over and over again the page " head.log.net/login?username=username&password=password ".

Im running a rb433 with 6.32.2 and wondering to use with capsman (capsman is running with 3 ssid without any issue)

One of this SSID will be the hotspot (for guests)

Could you give me some advice, please.

Thanks.
That's much simpler than you think.
First, create a user profile and a local user that is linked to the profile. The below assumes a username of 'username' and a password of 'password'.

Then make the following login.html:
<html>
<head>
<meta http-equiv="refresh" content="0; url=login?username=username&password=password">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>
That login.html is loaded for unauthorized users and usually has the login form, the above instead after 0 seconds causes an automatic redirect (HTTP code 302) to the login servlet of the Hotspot, passing on the correct user credentials and effectively logging the user in.

To cover all possible redirect conditions, create the following redirect.html and logout.html (they both get the same HTML) to in turn redirect to the above login.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>
After a successful login, alogin.html is loaded for the user. The below assumes that the page you want to show after login resides on an external server. If you want to host it on the router itself, just replace it with the HTML for the final landing screen.
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://my.external.server.com/landingpage.html">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>

Re: Hotspot splashpage / captive portal without auth

Posted: Wed Dec 30, 2015 10:12 pm
by Feklar
Do you have the external URL added to the walled garden of the hotspot?

Re: Hotspot splashpage / captive portal without auth

Posted: Wed Jan 25, 2017 7:30 pm
by ClaudioJunior10
Good afternoon Mikrotik
I made the hotspot confirmations in mikrotik and when I test in my notebook or computer the redirect works perfectly. The page that I set opens, but when I log in and connect through the mobile menu the page I defined as redirect does not open.
How can I solve this problem? I've read the documentation and did tests, but it still does not work.
I need this to work urgently.
Thank you

Re: RE: Re: Hotspot splashpage / captive portal without auth

Posted: Wed Jan 25, 2017 7:47 pm
by ErfanDL
Good afternoon Mikrotik
I made the hotspot confirmations in mikrotik and when I test in my notebook or computer the redirect works perfectly. The page that I set opens, but when I log in and connect through the mobile menu the page I defined as redirect does not open.
How can I solve this problem? I've read the documentation and did tests, but it still does not work.
I need this to work urgently.
Thank you
Hi
test it in android or ios?

Re: RE: Re: Hotspot splashpage / captive portal without auth

Posted: Thu Jan 26, 2017 4:45 am
by ClaudioJunior10
Good afternoon Mikrotik
I made the hotspot confirmations in mikrotik and when I test in my notebook or computer the redirect works perfectly. The page that I set opens, but when I log in and connect through the mobile menu the page I defined as redirect does not open.
How can I solve this problem? I've read the documentation and did tests, but it still does not work.
I need this to work urgently.
Thank you
Hi
test it in android or ios?
android my friend.
KNOW HOW TO HELP ME?

Re: RE: Re: RE: Re: Hotspot splashpage / captive portal without auth

Posted: Thu Jan 26, 2017 12:26 pm
by ErfanDL
Good afternoon Mikrotik
I made the hotspot confirmations in mikrotik and when I test in my notebook or computer the redirect works perfectly. The page that I set opens, but when I log in and connect through the mobile menu the page I defined as redirect does not open.
How can I solve this problem? I've read the documentation and did tests, but it still does not work.
I need this to work urgently.
Thank you
Hi
test it in android or ios?
android my friend.
KNOW HOW TO HELP ME?
Rename the hotspot dns name to hotspot.pt

Re: RE: Re: RE: Re: Hotspot splashpage / captive portal without auth

Posted: Thu Jan 26, 2017 1:13 pm
by ClaudioJunior10
Good afternoon Mikrotik
I made the hotspot confirmations in mikrotik and when I test in my notebook or computer the redirect works perfectly. The page that I set opens, but when I log in and connect through the mobile menu the page I defined as redirect does not open.
How can I solve this problem? I've read the documentation and did tests, but it still does not work.
I need this to work urgently.
Thank you
Hi
test it in android or ios?
android my friend.
KNOW HOW TO HELP ME?
Rename the hotspot dns name to hotspot.pt
I'll do it, my friend. thanks for listening

Re: RE: Re: RE: Re: RE: Re: Hotspot splashpage / captive portal without auth

Posted: Thu Jan 26, 2017 1:15 pm
by ErfanDL
Good afternoon Mikrotik
I made the hotspot confirmations in mikrotik and when I test in my notebook or computer the redirect works perfectly. The page that I set opens, but when I log in and connect through the mobile menu the page I defined as redirect does not open.
How can I solve this problem? I've read the documentation and did tests, but it still does not work.
I need this to work urgently.
Thank you
Hi
test it in android or ios?
android my friend.
KNOW HOW TO HELP ME?
Rename the hotspot dns name to hotspot.pt
I'll do it, my friend. thanks for listening
Your welcome. Is your problem solved?

Re: RE: Re: RE: Re: RE: Re: Hotspot splashpage / captive portal without auth

Posted: Fri Jan 27, 2017 2:22 pm
by ClaudioJunior10
Hi
test it in android or ios?
android my friend.
KNOW HOW TO HELP ME?
Rename the hotspot dns name to hotspot.pt
I'll do it, my friend. thanks for listening
Your welcome. Is your problem solved?
Hello, unfortunately not
I configured my mikrotik as follows: I connected a LAN, a wired interface and a wireless one. Then I enabled a bridge by putting the wired and wireless interface. I have enabled DHCP Client and DHCP Server and NAT.
After that I enabled the hotspot by placing the bridge inside it, a default setting.
I edited login.html and alogin.html to redirect to a site initially as a test, but in the final project I want to redirect to a page I am developing on my local machine, in localhost.
The redirect of the hotspot on my computer works perfectly for both the web page and the page I am developing, but on my phone it opens the hotspot login, redirects, "loads and displays 2 seconds and returns to the wifi settings of the cell phone , Confirming that the network has been connected.
Any doubts I am available.

Re: Hotspot splashpage / captive portal without auth

Posted: Sun Jan 29, 2017 2:16 am
by ClaudioJunior10
I configured my mikrotik as follows: I connected a LAN, a wired interface and a wireless one. Then I enabled a bridge by putting the wired and wireless interface. I have enabled DHCP Client and DHCP Server and NAT.
After that I enabled the hotspot by placing the bridge inside it, a default setting.
I edited login.html and alogin.html to redirect to a site initially as a test, but in the final project I want to redirect to a page I am developing on my local machine, in localhost.
The redirect of the hotspot on my computer works perfectly for both the web page and the page I am developing, but on my phone it opens the hotspot login, redirects, "loads and displays 2 seconds and returns to the wifi settings of the cell phone , Confirming that the network has been connected.
Any doubts I am available.