Community discussions

MikroTik App
 
linuxciscodaniel
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 73
Joined: Sat Aug 08, 2009 10:58 pm

HotSpot Redirect To External Login Page

Fri Apr 09, 2010 10:34 am

Excuse me for my bad english

i want to redirect the login page to External server.
i want use the hotspot with the hotspot directory of Files option to external server web
how can do for that?

what file can i modify ?

Thanks advance for your help
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: HotSpot Redirect To External Login Page

Fri Apr 09, 2010 2:12 pm

This is from the RouterOS manual. Replace login.html code with this. Edit the URL to yours, of course.
<html>
<title>...</title>
<body>
<form name="redirect" action="https://auth.example.com/login.php" method="post">
<input type="hidden" name="mac" value="$(mac)">
<input type="hidden" name="ip" value="$(ip)">
<input type="hidden" name="user" value="$(username)">
<input type="hidden" name="link-login" value="$(link-login)">
<input type="hidden" name="link-orig" value="$(link-orig)">
<input type="hidden" name="error" value="$(error)">
</form>
<script language="JavaScript">
<!--
	document.redirect.submit();
//-->
</script>
</body>
</html>
Insure to put the url of the server in "/ip hotspot walled-garden" so it will redirect ok.
 
linuxciscodaniel
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 73
Joined: Sat Aug 08, 2009 10:58 pm

Re: HotSpot Redirect To External Login Page

Fri Apr 09, 2010 7:44 pm

ok thanks for your help
 
linuxciscodaniel
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 73
Joined: Sat Aug 08, 2009 10:58 pm

Re: HotSpot Redirect To External Login Page

Mon Apr 12, 2010 1:13 pm

ok it work
but i have a problem

the radius server is external but i can't use my radius server because i receive correctly the authentification page but when i enter my username et password i don't receive the reply

how can i do this issue with my radius server when i use the external page login
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: HotSpot Redirect To External Login Page

Mon Apr 12, 2010 2:10 pm

I don't use external login pages, but the external page login form you use to login to the hotspot must be sent to the same ip (look in "/ip hotspot profile" for the address of the hotspot) as the local page form. The same data must be included in the form. If you use the http-chap login type, you need to insure the md5 encryption routine is run on the password before the form is submitted.

ADD: The radius authentication is done after the login page submission. What does the log in the hotspot router say about the radius transaction?

Also, remember since a remote server is sending the page, the remote server will need to fill in all the $(xxx) variables that are on the local login.html page before sending it to your browser.
 
linuxciscodaniel
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 73
Joined: Sat Aug 08, 2009 10:58 pm

Re: HotSpot Redirect To External Login Page

Mon Apr 12, 2010 11:22 pm

ok thanks
 
Etza
newbie
Posts: 46
Joined: Tue May 31, 2011 10:33 pm

Re: HotSpot Redirect To External Login Page

Wed Dec 18, 2013 10:10 pm

This is from the RouterOS manual. Replace login.html code with this. Edit the URL to yours, of course.
<html>
<title>...</title>
<body>
<form name="redirect" action="https://auth.example.com/login.php" method="post">
<input type="hidden" name="mac" value="$(mac)">
<input type="hidden" name="ip" value="$(ip)">
<input type="hidden" name="user" value="$(username)">
<input type="hidden" name="link-login" value="$(link-login)">
<input type="hidden" name="link-orig" value="$(link-orig)">
<input type="hidden" name="error" value="$(error)">
</form>
<script language="JavaScript">
<!--
	document.redirect.submit();
//-->
</script>
</body>
</html>
Insure to put the url of the server in "/ip hotspot walled-garden" so it will redirect ok.





Do you know code for add extra fields in signup form ?.

Who is online

Users browsing this forum: 4l4R1 and 55 guests