Community discussions

MikroTik App
 
bradleyshaw
just joined
Topic Author
Posts: 8
Joined: Fri Oct 06, 2006 1:07 am

Hotspot auto-login

Fri Oct 06, 2006 1:39 am

Here is the deal. I have a MT configured with the hotspot with trial authentication enabled and everything works great as far as being able to get trial access by clicking the trial link. My question is: Can you modify the .html pages in the hotspot folder to automatically login a trial user and if so, what is the specific code to do so as I am NO web guy at all.

Thank You,
Bradley Shaw
 
bradleyshaw
just joined
Topic Author
Posts: 8
Joined: Fri Oct 06, 2006 1:07 am

Fri Oct 06, 2006 4:19 pm

BUMP
 
User avatar
GWISA
Member
Member
Posts: 389
Joined: Tue Jan 31, 2006 2:37 pm
Location: Johannesburg, South Africa

Mon Oct 09, 2006 12:59 am

..
 
bradleyshaw
just joined
Topic Author
Posts: 8
Joined: Fri Oct 06, 2006 1:07 am

Tue Oct 17, 2006 11:40 pm

Bump...
 
User avatar
jscoulter
newbie
Posts: 39
Joined: Fri Sep 15, 2006 1:32 am

Wed Oct 18, 2006 12:33 am

Under your HotSpot profile, select Cookie and if you need to when the cookie will expire. This should solve the problem.

Jeremy
 
bradleyshaw
just joined
Topic Author
Posts: 8
Joined: Fri Oct 06, 2006 1:07 am

Wed Oct 18, 2006 12:40 am

Under your HotSpot profile, select Cookie and if you need to when the cookie will expire. This should solve the problem.

Jeremy
Well once I click the trial button, everything works fine. And if I close the web browser and open it back up, I can still surf until the cookie expires but I don't want the user to ever click anything. I just want them to be automatically logged in the first time as a trial user.
 
User avatar
jscoulter
newbie
Posts: 39
Joined: Fri Sep 15, 2006 1:32 am

Wed Oct 18, 2006 12:49 am

this is certainly possible, but would require some changes to the HTML login page on the MikroTik.

Can I get a clearer picture of whats happening. Does the hotspot ONLY let trial users login? or can registered users also login?

If its only for one type of user, a trial user, then it should be res. straight forward.

Jeremy
 
bradleyshaw
just joined
Topic Author
Posts: 8
Joined: Fri Oct 06, 2006 1:07 am

Wed Oct 18, 2006 1:51 am

this is certainly possible, but would require some changes to the HTML login page on the MikroTik.

Can I get a clearer picture of whats happening. Does the hotspot ONLY let trial users login? or can registered users also login?

If its only for one type of user, a trial user, then it should be res. straight forward.

Jeremy
Yeah for now we are going to be just trial users. Here is basically what we are wanting to do is have it to where when a person opens up their laptop and connects to our wireless network and they open a web browser, they get redirected to a webpage(not for authentication or anything like that, just advertisment) and then they can surf to whereever they want but for only like 30 minutes. The problem is, we don't want them to have to click "trial" to go to the webpage. I know that all you have to do is modify the login.html page to do the automatic login but I have no idea what the code would be. There is alot of mikrotik specific stuff in that page and I don't know what I am doing as far as that goes. Would you happen to know of anyone that would have an example login.html or know what html code I need to modify mine? Any help would be awsome. thank you.
 
csickles
Forum Guru
Forum Guru
Posts: 1255
Joined: Fri May 28, 2004 8:46 pm
Location: Phoenix, AZ
Contact:

Wed Oct 18, 2006 2:07 am

A "Click to use system" isnt nessisaraly a "bad thing..."
It can provide you a measure of legal protection..

IE: Post a brief message RE: acceptable use etc.

Then have an accept button (aliase of the trial button) on the page..

If a posting on an automated page is displayed for a few seconds and then the user is automaticly forwarded to a page of the users choice, there is an argument to be made that the user was unaware of any use agreement.. By making the user click a buton, you force them to take an action to accept the policy. this gives you some protection from what the user may do on your system..

Just the paranoia side of me...

On the otherhand, there is java script that can click a buton for you after a specified period of time.. I remember reading one..

Craig
 
User avatar
jscoulter
newbie
Posts: 39
Joined: Fri Sep 15, 2006 1:32 am

Wed Oct 18, 2006 3:20 am

I have AN idea that might work, but will need to check it. Give me a day or so...or less.

Jeremy
 
bradleyshaw
just joined
Topic Author
Posts: 8
Joined: Fri Oct 06, 2006 1:07 am

Fri Oct 20, 2006 5:15 pm

A "Click to use system" isnt nessisaraly a "bad thing..."
It can provide you a measure of legal protection..

IE: Post a brief message RE: acceptable use etc.

Then have an accept button (aliase of the trial button) on the page..

If a posting on an automated page is displayed for a few seconds and then the user is automaticly forwarded to a page of the users choice, there is an argument to be made that the user was unaware of any use agreement.. By making the user click a buton, you force them to take an action to accept the policy. this gives you some protection from what the user may do on your system..

Just the paranoia side of me...

On the otherhand, there is java script that can click a buton for you after a specified period of time.. I remember reading one..

Craig

Thats a cool idea. I will have to run that by the powers that be.
 
bradleyshaw
just joined
Topic Author
Posts: 8
Joined: Fri Oct 06, 2006 1:07 am

Fri Oct 20, 2006 5:16 pm

I have AN idea that might work, but will need to check it. Give me a day or so...or less.

Jeremy
Great! I look forward to hearing from you.
 
User avatar
jscoulter
newbie
Posts: 39
Joined: Fri Sep 15, 2006 1:32 am

Sun Oct 22, 2006 8:36 am

SORRY for the late reply.
Actually, this was a really simple thing to do.

Basically, all you do is populate the username and password boxes via javascript, then call the function "doLogin()".
I WAS about to say...dont paminc here is the HTML file I altered for you, but I cant see how to add an attachment to this message, s email me @ jeremy@telsoft.net.nz and I wll send it to you.
once you have the file, all you need to do is, open the HTML file in your prefered html editor, or open it in notepad, scroll to the bottom where you will find :-
document.login.username.value='username';
document.login.password.value='password';

replace the 'username' and 'password' text with your test user login details then save the file, then ftp the file up to your mikrotik.....just make sure yu back up the one that is on there now.
Then when thats done, you can access a site on a machine that talks t the mikrotik and it will/should quickly disply the login page, but then automatically log the user in, and away you go.

Let me know how it goes.

Jeremy
 
bradleyshaw
just joined
Topic Author
Posts: 8
Joined: Fri Oct 06, 2006 1:07 am

Tue Oct 24, 2006 12:04 am

SORRY for the late reply.
Actually, this was a really simple thing to do.

Basically, all you do is populate the username and password boxes via javascript, then call the function "doLogin()".
I WAS about to say...dont paminc here is the HTML file I altered for you, but I cant see how to add an attachment to this message, s email me @ jeremy@telsoft.net.nz and I wll send it to you.
once you have the file, all you need to do is, open the HTML file in your prefered html editor, or open it in notepad, scroll to the bottom where you will find :-
document.login.username.value='username';
document.login.password.value='password';

replace the 'username' and 'password' text with your test user login details then save the file, then ftp the file up to your mikrotik.....just make sure yu back up the one that is on there now.
Then when thats done, you can access a site on a machine that talks t the mikrotik and it will/should quickly disply the login page, but then automatically log the user in, and away you go.

Let me know how it goes.

Jeremy

Thank you so much for all of your help. I will be in touch via email.
 
jemsenator
just joined
Posts: 18
Joined: Sat May 01, 2010 6:51 pm

Re: Hotspot auto-login

Sat May 07, 2011 5:24 pm

Good day
Please help me, I want a solution that will create a system where the prospecting hotspot users will select a plan, make payment via (an integrated card chip/merchant) and then be redirected to the registration page to accept the terms and login immediately with the created account.

Thanks
Patrick
 
Boter
Frequent Visitor
Frequent Visitor
Posts: 73
Joined: Sat Sep 08, 2012 9:55 pm
Contact:

Re: Hotspot auto-login

Sun Jul 12, 2015 1:34 pm

Did you ever managed this to work?
 
Iron
just joined
Posts: 5
Joined: Wed Jan 19, 2011 11:24 am

Re: Hotspot auto-login

Sat Jul 25, 2020 11:02 pm

Hi there. This code worked for me. Upload this code as login.html on router.
<html>
    <head>
         <title></title>
    </head>
    <body>
	<script type="text/javascript" src="/md5.js"></script>
        <div>
            <a id="linkid" href="$(link-login-only)?dst=$(link-orig-esc)&amp;username=T-$(mac-esc)">click here</a>
        </div>
        
       <script type="text/javascript">
           window.onload=function(){
            document.getElementById("linkid").click();
             };
        </script>
        
    </body>
</html>