Community discussions

MikroTik App
 
AlexeyISG
just joined
Topic Author
Posts: 2
Joined: Wed Feb 22, 2017 10:11 am

Automatic login to HotSpot in Trial mode

Wed Feb 22, 2017 10:51 am

Is it possible to set up mikrotik hotspot in automatic trial mode for a cafe visitor without any authentication window, but with time limit per day (Trial Uptime Limit/Trial Uptime Reset)?
Without Javascript on the client side as possible.
 
User avatar
scotthammersley
Member Candidate
Member Candidate
Posts: 230
Joined: Fri Feb 22, 2013 7:16 pm
Location: Jackson, MS
Contact:

Re: Automatic login to HotSpot in Trial mode

Wed Feb 22, 2017 5:46 pm

Yes, you need to alter/create your own login.html that basically takes the login parameters with a meta refresh to the hotspot. Basically something like this would need to be placed inside login.html (this is part of the hotspot file system withing routeros);
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://"YOUR_ROUTER_IP/DNS"/login?username=T-$(mac-esc)&dst=http://www.google.com" />
</head>
</html>
Obviously makes sure to change "YOUR_ROUTER_IP/DNS" with the correct URL. You can change the DST after login also. You will need to ensure the trial option is checked withing the hotspot configuration also.

I recommend backing up all current files and configuration, just to be on the safe side too.
 
AlexeyISG
just joined
Topic Author
Posts: 2
Joined: Wed Feb 22, 2017 10:11 am

Re: Automatic login to HotSpot in Trial mode

Thu Feb 23, 2017 1:48 pm

Thank You fore the quick reply. I try this one, but didn't work - cyclic reload :-(
 
ik3umt
Member Candidate
Member Candidate
Posts: 295
Joined: Tue Jul 08, 2014 3:58 pm

Re: Automatic login to HotSpot in Trial mode

Fri Aug 02, 2019 12:52 pm

For me it works this way:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="refresh" content="0; url=http://10.0.0.1/login?username=T-$(mac-esc)" />
</head>
</html>
If needed, alogin.html will provide automatic redirection to i.e. the cafe' webpage :

modify these lines in alogin.html :
<meta http-equiv="refresh" content="2; url=YOURDESIREDURL">


location.href = unescape('YOURDESIREDURL');             ****** within single quotes*****

Who is online

Users browsing this forum: No registered users and 29 guests