Hotspot auto-login

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

BUMP

..

Bump…

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.

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.

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

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

Jeremy

Thats a cool idea. I will have to run that by the powers that be.

Great! I look forward to hearing from you.

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.

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

Did you ever managed this to work?

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>