Community discussions

MikroTik App
 
User avatar
sguox
Trainer
Trainer
Topic Author
Posts: 73
Joined: Fri Mar 09, 2012 6:23 pm

Hotspot Login External Page

Sun Mar 18, 2012 3:55 am

Hi All,

I am trying to setup an external login page by following instruction in http://wiki.mikrotik.com/wiki/HotSpot_e ... login_page

I have setup hotspot in routerboard using Hotspot Setup.

The problem i encounter is if i insert correct path for md5.js in the login page, login will always fail. However if i delete the line that loading md5.js or put wrong path so i can't load, login will be working fine. Appreciate if anyone can point out what's wrong with my setup.
 
reverged
Member Candidate
Member Candidate
Posts: 270
Joined: Thu Nov 12, 2009 8:30 am

Re: Hotspot Login External Page

Sun Mar 18, 2012 6:17 am

You gave no details about your setup, but a clue is that md5.js is required for chap and not pap.

A wild guess:

You have login-by=http-chap and you need login-by=http-pap set, so including md5.js would break things.
Leaving md5.js out should throw a js error in your browser, but the line:
document.sendin.password.value = hexMD5('<?php echo $chapid; ?>' + document.login.password.value + '<?php echo $chapchallenge; ?>');
Would leave the password value unchanged, perhaps, if function hexMD5 is missing. i.e. md5.js is missing.

Check:
/ip hotspot profile print
and check the "login-by" value.

End of wild guess.
 
User avatar
sguox
Trainer
Trainer
Topic Author
Posts: 73
Joined: Fri Mar 09, 2012 6:23 pm

Re: Hotspot Login External Page

Sun Mar 18, 2012 11:54 am

the setup was configured using hotspot setup wizard, so all the settings are default. i checked the server profile, it has both http-chap and http-pap enabled.
 
User avatar
sguox
Trainer
Trainer
Topic Author
Posts: 73
Joined: Fri Mar 09, 2012 6:23 pm

Re: Hotspot Login External Page

Sun Mar 18, 2012 11:57 am

when i am at the login page, i tried to view html source and able to see some strings generated for hexMD5 line, so i assume this mean that i am on chap ?
 
reverged
Member Candidate
Member Candidate
Posts: 270
Joined: Thu Nov 12, 2009 8:30 am

Re: Hotspot Login External Page

Mon Mar 19, 2012 3:53 am

It's difficult to predict what is wrong without all the pieces.

Are you using a radius server or user settings?

What actually happens when you login?

Turn on hotspot and radius logging in the MT and you will see what is going on.

Put an error_log in your php file. Something like:
error_log(print_r($_POST, true));
Then you can see exactly what is posted to your page during the redirect.

Who is online

Users browsing this forum: Amazon [Bot], mkx and 74 guests