Community discussions

 
risipetillo
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 63
Joined: Tue Feb 03, 2009 7:08 pm

Integrating Facebook Connect with Hotspot Login / Authent ..

Thu Aug 20, 2009 7:24 am

Dear all,

Has anyone been able to integrate facebook connect with their Hotspot Authentication process.

I think there could be real value in having such an integration in Mikrotik Hotspots.

What are your thoughts and ideas about this?

I think it would be an interesting topic to discuss at the upcoming MUM in Dallas which I'm hoping to attend.
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6610
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Integrating Facebook Connect with Hotspot Login / Authent ..

Thu Aug 20, 2009 10:06 am

What kind of functions do you want to integrate to MikroTik HotSpot ?
 
risipetillo
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 63
Joined: Tue Feb 03, 2009 7:08 pm

Re: Integrating Facebook Connect with Hotspot Login / Authent ..

Thu Aug 20, 2009 7:55 pm

I would love to have an option for users to authenticate into the hotspot using their facebook username/ password ... similar to how users are able to authenticate into websites with the Facebook Connect API, Twitter connect etc.

Of course this would probably work well in only Free-based hotspots, but it would make it easier for users to login (No need to create "another" username / password combo to authenticate into the hotspot), as well as having some kind of accountablility as to who was using the hotspot via their facebook creds info.

The world is moving in the direction of social networking, and I think such an authentication option would be wildly popular, and would be a progressive move which would once again set mikrotik apart from the competition ... a purple cow ... in a sea of regular cows :)
 
fewi
Forum Guru
Forum Guru
Posts: 7734
Joined: Tue Aug 11, 2009 3:19 am

Re: Integrating Facebook Connect with Hotspot Login / Authent ..

Thu Aug 20, 2009 8:13 pm

Looking at the Facebook API, it's fairly simple to include a login button that fires a JavaScript event on successful login. (http://wiki.developers.facebook.com/ind ... n_Websites)

So just host the hotspot login page externally and include their API as described above. Make the JavaScript function that fires redirect to either
- the hotspot directly (hotspot/login?username=hardcoded_username&password=hardcoded_password)
- a page under your control that uses the MT API to create equivalent usernames/passwords locally on the MT, then redirect to the hotspot and login with those credentials
- a page under your control that inserts credentials into an external RADIUS solution, then redirect to the hotspot and login with those
- etc.

HTH,
Felix
Specific answers require specific questions. When in doubt, post the output of "/ip address print detail", "/ip route print detail", "/interface print detail", "/ip firewall export", and an accurate network diagram.
 
User avatar
kimssky
just joined
Posts: 23
Joined: Sat Jan 02, 2010 1:13 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Sat May 28, 2011 5:59 am

This solution would also offer an interest to me. Hotspot Client authorizes comfortable Facebook account.
 
mm690
Frequent Visitor
Frequent Visitor
Posts: 54
Joined: Sat Aug 21, 2010 8:38 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Sun May 29, 2011 8:47 pm

+1

MT would really get some serious kudos releasing this. A simple script to add to our hotspot html that useres requested. Would create some good buzz for MT.
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Mon May 30, 2011 9:36 pm

I could see this working really well for public hotspots since most users already have an account (facebook, gmail, yahoo, etc...)
Doug
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 23608
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Integrating Facebook Connect with Hotspot Login / Authen

Tue May 31, 2011 8:33 am

the procedure that fewi describes indicates that this is to be done externally, so if one of you can write a solution and post on the wiki, you will receive a license and everyone will have the solution they wanted.
No answer to your question? How to write posts
 
blake
Member
Member
Posts: 426
Joined: Mon May 31, 2010 10:46 pm
Location: Arizona

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed Jun 01, 2011 3:12 am

the procedure that fewi describes indicates that this is to be done externally, so if one of you can write a solution and post on the wiki, you will receive a license and everyone will have the solution they wanted.
Level 6 license? 8)
IT consultant. Network manager. Packet junkie.
1-928-328-1509
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 23608
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed Jun 01, 2011 7:30 am

yes, level6 license for a nicely formatted wiki article about this topic. of course if many of them will be made, only the best article will receive it.
No answer to your question? How to write posts
 
reeeq
just joined
Posts: 16
Joined: Tue Apr 28, 2009 5:25 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Fri Jun 03, 2011 1:19 pm

a page under your control that uses the MT API to create equivalent usernames/passwords locally on the MT, then redirect to the hotspot and login with those credentials
means that the network admin has the username and password of the user that can be use to get through their facebook account.. ? :)
I think this is work like a logger of fake website to get facebook user's username and password.
 
fewi
Forum Guru
Forum Guru
Posts: 7734
Joined: Tue Aug 11, 2009 3:19 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Fri Jun 03, 2011 5:14 pm

You do not have to know the password. Just an equivalent. Use the Facebook credentials email address for both username and password, for example.
Specific answers require specific questions. When in doubt, post the output of "/ip address print detail", "/ip route print detail", "/interface print detail", "/ip firewall export", and an accurate network diagram.
 
tchus
Member Candidate
Member Candidate
Posts: 111
Joined: Tue Jan 25, 2011 12:08 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed Jun 15, 2011 3:07 am

Still nobody has created/shared a script to make this login possible? :?
 
rickfry
just joined
Posts: 1
Joined: Tue Dec 04, 2012 11:48 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Sun Jan 27, 2013 10:01 pm

It's been a while since anyone post to this. Is that because there are no solutions or no demand ?

If its down to money what would be the cost to develop the solution
 
User avatar
chimaster
Member Candidate
Member Candidate
Posts: 125
Joined: Tue Feb 07, 2006 8:54 am
Location: Queenstown
Contact:

Re: Integrating Facebook Connect with Hotspot Login / Authen

Mon Feb 18, 2013 11:32 pm

Anyone get anywhere on this?

We're about to try and set this up but no need to re-invent the wheel... :-)
 
SamWCL
Frequent Visitor
Frequent Visitor
Posts: 76
Joined: Mon Apr 20, 2009 1:18 pm
Location: Wellington, NZ

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed Mar 13, 2013 4:22 am

Bump!
 
User avatar
chimaster
Member Candidate
Member Candidate
Posts: 125
Joined: Tue Feb 07, 2006 8:54 am
Location: Queenstown
Contact:

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed Mar 13, 2013 8:39 am

Always appreciate some Karma, hopefully get some more when we post the Email Address or Facebook Like for access to trial script. It'll be a month. But it's coming.

Cheers
MTCNA - MTCWE - MTCRE - All round good guy and Linux nut
<plug>
HQWiFi making http://www.queenstown.com Wireless since 2001.
</plug>
 
butko
just joined
Posts: 6
Joined: Sat Jul 30, 2011 7:07 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Tue Mar 19, 2013 11:31 am

Always appreciate some Karma, hopefully get some more when we post the Email Address or Facebook Like for access to trial script. It'll be a month. But it's coming.

Cheers
Nice, I'm willing to help so contact me if you need extra hands. here is my mail: podrska(at)tm2.hr
 
mausek
just joined
Posts: 5
Joined: Fri Apr 05, 2013 12:43 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Fri Apr 05, 2013 12:55 am

Hi to all!

Finally I found a topic, where people are talking about FB connect integration into MT hotspot.
Basically I made it, but there is a problem, because Mikrotik HotSpot walled garden won't accept https hosts
(it's strange, because sometimes it accepts, sometimes it doesn't).

How to solve it? I found some topics on google, people says to put the IP's from the domain into the IP Walled garden list.
OK. The next thing is, facebook uses a lot of IP addresses, and an external CDN for static files like images, stylesheets, JS files etc.

How to add all IP addresses from Facebook into Mikrotik's IP walled garden list?

I hope U understand what I'm talking about.
Best regards, R.
 
spire2z
Long time Member
Long time Member
Posts: 517
Joined: Mon Feb 14, 2005 2:48 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Fri Apr 05, 2013 4:18 am

Just put the dst host dst port and protocol into walled garden ip list. I think thats it!
 
mausek
just joined
Posts: 5
Joined: Fri Apr 05, 2013 12:43 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Fri Apr 05, 2013 10:25 am

I triied like spire2z said, but with no luck.

Here are screenshots from my phone:
Could not establish secure connection
Image

Then I added same hosts to the walled garden and the styles from CDN couldn't be loaded
Image
[admin@MikroTik] > /ip hotspot walled-garden print 
Flags: X - disabled, D - dynamic 
 #   SERVER     METHOD  DST-HOST                               DST-PORT   PATH                 
 0 X ;;; place hotspot rules here
                                                                                               
 1                      hotspot.catena.si*                                                     
 2   hotspot1           *facebook.com*                         443                             
 3   hotspot1           *.facebook.com*                        80                              
 4   hotspot1           *akamaihd.net*                         443                             
 5   hotspot1           *akamaihd.net*                         80                      
[admin@MikroTik] > /ip hotspot walled-garden ip print 
Flags: X - disabled, I - invalid 
 #   SERVER                                    PROTOCOL   DST-HOST                                    DST-ADDRESS     DST-PORT   ACTION
 0 I hotspot1                                  tcp        www.facebook.com*                                           443        accept
 1 I hotspot1                                  tcp        www.facebook.com*                                           80         accept
 2 I hotspot1                                  tcp        *akamaihd.net*                                              443        accept
 3 I hotspot1                                  tcp        *akamaihd.net*                                              80         accept
Any ideas?
 
Znuff
Member Candidate
Member Candidate
Posts: 139
Joined: Tue Sep 26, 2006 2:42 am
Contact:

Re: Integrating Facebook Connect with Hotspot Login / Authen

Sun Apr 07, 2013 12:21 am

What's your progress on this?

Are you using the Connect method (with the JavaScript SDK)? Or simply asking for a Like (without an App confirmation)?

I'm interested in doing something like this, too, and I was just looking into Facebook's API.

If you're using the App method - where are you hosting it? Are you using Heroku?
 
mausek
just joined
Posts: 5
Joined: Fri Apr 05, 2013 12:43 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Sun Apr 07, 2013 1:23 am

Hi!

I'm using the facebook connect php api.
In the meantime I solved the problem with the walled garden and everything is working fine now.

When I'll finish my project, I'll post the config here.

@Znuff you can find me on skype (my skypename: mausek) if you need some additional info how to do it.

Best regards!
 
xskid
just joined
Posts: 3
Joined: Sat Oct 31, 2009 1:25 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Tue Apr 09, 2013 9:48 am

Hi Mausek,
I'm search also for FB connect but don't know where to start within ROS.
Can we share some info offlist?
Regards,
Jaap
 
dw70
just joined
Posts: 15
Joined: Thu Mar 07, 2013 11:45 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed Apr 10, 2013 1:17 pm

Hello Mausek,

I would be very interested in your solution. I am also trying to integrate this into my hotspot but without any luck sofar. Are you willing to share your solution? We own an espressobar and I want to offer our customers the opportunity to login via facebook.

Dennis
 
ahmad210993
just joined
Posts: 16
Joined: Sun Mar 10, 2013 3:43 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed Apr 17, 2013 9:25 am

Hey all,
I want to share that I've succeed integrating login hotspot mikrotik using facebook.
The method is bypass all facebook.com host, port 80 and 443. and then use Facebook app and some PHP and API script to combine with mikrotik API.
I am using email as username and password.
here some screenshot,
Image
Image
Image
Image

but there's a bug, this method only work if you used PC / Laptop for login.
I haven't success using smartphone/mobile phone.
.... so if one of you can write a solution and post on the wiki, you will receive a license and everyone will have the solution they wanted.
Is this counted if I write my sample?

*sorry for my English, it's not my native language. :)
 
ahmad210993
just joined
Posts: 16
Joined: Sun Mar 10, 2013 3:43 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Thu Apr 18, 2013 1:29 pm

Anyway here I made some tutorial for what I've done,
here is the link:
http://www.ragilakimoto.com/2013/04/log ... ebook.html

It's using Bahasa (Indonesia Language), so if you want to read it in English, use Google translate :)
Or click here to auto translate to English,
Last edited by ahmad210993 on Thu Jun 27, 2013 2:21 pm, edited 1 time in total.
 
brasileottanta
Member Candidate
Member Candidate
Posts: 119
Joined: Thu Jun 22, 2006 8:52 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Tue May 21, 2013 6:58 pm

Anyway here I made some tutorial for what I've done,
here is the link:
http://blog.dyasrtrw.net/2013/04/login- ... ebook.html

It's using Bahasa (Indonesia Language), so if you want to read it in English, use Google translate :)
Or click here to auto translate to English,
Hello ,

I follow your tutorial , but no lucky. I put user.php and routeros class API in web server , login.html inside hotspot directory of MT. I can create a new user inside MT , but no authentications inside MT.

Web server with FQDN , MT with public static IP on different address. FB application with correct parameters. I think that in your tutorial forgot same step.

Can you help me ?

Can you publish here the correct login.html file and user.php ?

Thank's in advance.

p.s. I try a new way with external captive authentication .
 
ahmad210993
just joined
Posts: 16
Joined: Sun Mar 10, 2013 3:43 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed May 22, 2013 5:19 am

Anyway here I made some tutorial for what I've done,
here is the link:
http://blog.dyasrtrw.net/2013/04/login- ... ebook.html

It's using Bahasa (Indonesia Language), so if you want to read it in English, use Google translate :)
Or click here to auto translate to English,
Hello ,

I follow your tutorial , but no lucky. I put user.php and routeros class API in web server , login.html inside hotspot directory of MT. I can create a new user inside MT , but no authentications inside MT.

Web server with FQDN , MT with public static IP on different address. FB application with correct parameters. I think that in your tutorial forgot same step.

Can you help me ?

Can you publish here the correct login.html file and user.php ?

Thank's in advance.

p.s. I try a new way with external captive authentication .
Hello.. thanks for giving feedback about my work.
here I give you source code from my work,
http://www.dyasrtrw.net/fb/login-facebo ... e-code.rar

I think you're right, there's one think I forgot to write on my tutorial, that was Hotspot Walled-Garden (to enable user to open facebook page without need to login).
so here somethink you need to do:
1. open IP>Hotspot>Walled Garden IP List
2. add this address and allow it,
#    SERVER     PROTOCOL   DST-HOST                  DST-ADDRESS     DST-PORT   ACTION
 0  hotspot1     tcp             www.facebook.com                              443        accept
 1  hotspot1     tcp             www.facebook.com                              80          accept
 2  hotspot1     tcp             connect.facebook.net                           443        accept
 3  hotspot1     tcp             connect.facebook.net                           80          accept
 4  hotspot1     tcp             *.facebook.com                                   443        accept
 5  hotspot1     tcp             *.facebook.com                                   80         accept
 6  hotspot1     tcp             *.akamaihd.net                                   443        accept
 7  hotspot1     tcp             *.akamaihd.net                                   80         accept
And you're done. :)
 
HaPe
Member Candidate
Member Candidate
Posts: 232
Joined: Fri Feb 10, 2012 10:24 pm
Location: Poland

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed May 22, 2013 8:01 am

Why do you use only Facebook? Maybe integrate hotspot with Openid, it is supported by google and the other popular services.
In anticipation on new The Dude release.
 
ahmad210993
just joined
Posts: 16
Joined: Sun Mar 10, 2013 3:43 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed May 22, 2013 8:34 am

Hm.. I haven't try it with any other site..
since this thread talking about integrating facebook connect so I was concentrated on Facebook.
but, why not? :)

Can you give some reference link? :D
 
HaPe
Member Candidate
Member Candidate
Posts: 232
Joined: Fri Feb 10, 2012 10:24 pm
Location: Poland

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed May 22, 2013 8:58 am

In anticipation on new The Dude release.
 
owen100
just joined
Posts: 1
Joined: Wed May 22, 2013 2:57 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed May 22, 2013 3:33 pm

What's your progress on this?
If you're using the App method - where are you hosting it? Are you using Heroku?

Are you using the Connect method (with the JavaScript SDK)? Or simply asking for a Like (without an App confirmation)?

I'm interested in doing something like this, too, and I was just looking into Facebook's API.
 
brasileottanta
Member Candidate
Member Candidate
Posts: 119
Joined: Thu Jun 22, 2006 8:52 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Wed May 22, 2013 7:34 pm

Thanks.
I found a solution to work with hotspot placed in NATted network . Basically using external captive portal.

This is my working configuration. According with your request.

What we need :

1 - a web server with FQDN or public static IP ( for facebook app registration )
2 - a MT appliance on any network ( NAT or private IP )

Step 1 - web server configuration.

Install a LAMP server ( you can use a virtual appliance hosted on some company like RackSpace )
Install OpenVpn server with IP 10.8.0.1 ( or what you want )
Install Xinetd service. Configure to forward all traffic from port 8728 to 10.8.0.2 ( the ip of MT ) port 8728
Put inside the directory of web server ( usually /var/www ) this files : user.php , routeros_api.php , login.php

Step 2 - MT configuration.

Install Hotspot in MT using wizard
Create a new interface OVPNClient , connect to OpenVpn server ( configured to send static ip , like 10.8.0.2 )
Enable Api service on standard port 8728
Create a user inside MT that use api , read and write permission
Create a Hotspot user profile with name facebook ( according limit with yours )
Using external captive portal page script ( found on wiki.mikrotik.com ) , login.html and put on hotspot/login.html. Modify with address of your web server as redirect.
Walled Garden the IP of web server .

How it work.
A client connect to hotspot.
redirect to web server
clic on facebook button
user.php write a new user inside MT using VPN
login.php make a redirection to hotspot with access .

Have fun !!!

ToDo:
Grant access only friends of page.

p.s. remember , work only for PC and Laptop. I working on smartphone/tablet solution ....

user.php :

<?php
$user=$_GET['user'];
$nama=$_GET['nama'];
$pass=$_GET['user'];
require('router_class.api.php');
$API = new routeros_api();
$API->debug = true;
if ($API->connect('web_ip','user_api','password')) {
$API->comm("/ip/hotspot/user/add", array(
"name" => $user,
"profile" => "facebook",
"limit-uptime" => "00:60:00",
"comment" => $nama,
"password" => $pass,
));
$READ = $API->read(false);
$ARRAY = $API->parse_response($READ);
print_r($ARRAY);
$API->disconnect();
}
?>


login.php :


<?php
$mac=$_POST['mac'];
$ip=$_POST['ip'];
$username=$_POST['username'];
$linklogin=$_POST['link-login'];
$linkorig=$_POST['link-orig'];
$error=$_POST['error'];
$chapid=$_POST['chap-id'];
$chapchallenge=$_POST['chap-challenge'];
$linkloginonly=$_POST['link-login-only'];
$linkorigesc=$_POST['link-orig-esc'];
$macesc=$_POST['mac-esc'];
$trial=$_POST['trial'];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Free HotSpot | Login Facebook</title>
<link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon">
<link rel="icon" href="../images/favicon.ico" type="image/x-icon">
<link href="css/style.css" type="text/css" rel="stylesheet" />
<style type="text/css">
.button
{
background: url(img/fb.png) no-repeat;
width: 100px;
height: 30px;
cursor:pointer;
border: none;
}
</style>
</head>

<body>
<div id="fb-root"></div>
<div id="user-info"></div>

<script>
window.fbAsyncInit = function() {
FB.init({ appId: 'YOUR_APP_ID',
status: true,
cookie: true,
xfbml: true,
oauth: true});

function updateButton(response) {
var button = document.getElementById('fb-auth');

if (response.authResponse) {
//user is already logged in and connected
var userInfo = document.getElementById('user-info');
FB.api('/me', function(response) {
userInfo.innerHTML = '<iframe src="http://YOUR_WEB_SERVER/user.php?user=' + response.email + '&nama=' + response.name + '" width="1" height="1"></iframe>';
wait(2000);

location='http://YOUR_HOTSPOT_IP/login?username=' + response.email + '&password=' + response.email ;
});
button.onclick = function() {
FB.logout(function(response) {
var userInfo = document.getElementById('user-info');
userInfo.innerHTML="";
});
};
} else {
//user is not connected to your app or logged out

button.onclick = function() {
FB.login(function(response) {
if (response.authResponse) {
FB.api('/me', function(response) {
var userInfo = document.getElementById('user-info');
});
} else {
//user cancelled login or did not grant authorization
}
}, {scope:'email'});
}
}
}

// run once with current status and whenever the status changes
FB.getLoginStatus(updateButton);
FB.Event.subscribe('auth.statusChange', updateButton);
};

(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol+ '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
function wait(msecs)
{
var start = new Date().getTime();
var cur = start
while(cur - start < msecs)
{
cur = new Date().getTime();
}
}
</script>
<div id="content">



<p><h4><font color="#000000">Hotspot Free with Facebook.</font></h4></p>
<font color="#000000" size="-1"><i>Working on pc/laptop</i></font>
<button id="fb-auth" class="button"></button>

</div>

<div id="footer">
Dyas RTRWnet © 2013.- airLAN contribution</a>
</div>

</div>
</body>
</html>


login.html ( put in hotspot dir of MT ) :

<html>
<head><title>........</title></head>
<body>
$(if chap-id)
<noscript>
<center><b>JavaScript required. Enable JavaScript to continue.</b></center>
</noscript>
$(endif)
<center>If you are not redirected in a few seconds, click 'continue' below<br>
<form name="redirect" action="http://YOUR_WEB_SERVER_IP/login.php" method="post">
<input type="hidden" name="mac" value="$(mac)">
<input type="hidden" name="ip" value="$(ip)">
<input type="hidden" name="username" 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)">
<input type="hidden" name="chap-id" value="$(chap-id)">
<input type="hidden" name="chap-challenge" value="$(chap-challenge)">
<input type="hidden" name="link-login-only" value="$(link-login-only)">
<input type="hidden" name="link-orig-esc" value="$(link-orig-esc)">
<input type="hidden" name="mac-esc" value="$(mac-esc)">
<input type="hidden" name="trial" value="$(trial)">
<input type="submit" value="continue">
</form>
<script language="JavaScript">
<!--
document.redirect.submit();
//-->
</script></center>
</body>
</html>
 
brasileottanta
Member Candidate
Member Candidate
Posts: 119
Joined: Thu Jun 22, 2006 8:52 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Thu May 23, 2013 11:52 pm

Just put the dst host dst port and protocol into walled garden ip list. I think thats it!
Hello ,

Is not enough . Ip of facebook change quickly. Sometime work , sometime not. ( for smartphone and tablet ) .



Bye.
 
brasileottanta
Member Candidate
Member Candidate
Posts: 119
Joined: Thu Jun 22, 2006 8:52 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Thu May 30, 2013 11:25 am

Hello ,


for working with ipad , iphone set this in walled garden:

dst host = www.apple.com

path = /library/test/success.html


brasileottanta
 
ahmad210993
just joined
Posts: 16
Joined: Sun Mar 10, 2013 3:43 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Fri Sep 20, 2013 5:53 pm

login.php make a redirection to hotspot with access .

login.php :


<?php
$mac=$_POST['mac'];
$ip=$_POST['ip'];
$username=$_POST['username'];
$linklogin=$_POST['link-login'];
$linkorig=$_POST['link-orig'];
$error=$_POST['error'];
$chapid=$_POST['chap-id'];
$chapchallenge=$_POST['chap-challenge'];
$linkloginonly=$_POST['link-login-only'];
$linkorigesc=$_POST['link-orig-esc'];
$macesc=$_POST['mac-esc'];
$trial=$_POST['trial'];

?>
...........
<div id="footer">
Dyas RTRWnet © 2013.- airLAN contribution</a>
</div>

</div>
</body>
</html>


login.html ( put in hotspot dir of MT ) :

<html>
<head><title>........</title></head>
<body>
$(if chap-id)
<noscript>
<center><b>JavaScript required. Enable JavaScript to continue.</b></center>
</noscript>
$(endif)
<center>If you are not redirected in a few seconds, click 'continue' below<br>
<form name="redirect" action="http://YOUR_WEB_SERVER_IP/login.php" method="post">
<input type="hidden" name="mac" value="$(mac)">
<input type="hidden" name="ip" value="$(ip)">
<input type="hidden" name="username" 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)">
<input type="hidden" name="chap-id" value="$(chap-id)">
<input type="hidden" name="chap-challenge" value="$(chap-challenge)">
<input type="hidden" name="link-login-only" value="$(link-login-only)">
<input type="hidden" name="link-orig-esc" value="$(link-orig-esc)">
<input type="hidden" name="mac-esc" value="$(mac-esc)">
<input type="hidden" name="trial" value="$(trial)">

<input type="submit" value="continue">
</form>
<script language="JavaScript">
<!--
document.redirect.submit();
//-->
</script></center>
</body>
</html>
Errr... I'd like to ask..
you said that login.php used to make a redirection to hotspot with access, but the one thing I need to ask is,
the text that I bold, what it is for?
from what I read, I think it doesn't do anything related to hotspot login process/method.

CMIIW :)
 
aleprolit
just joined
Posts: 18
Joined: Thu Apr 11, 2013 11:36 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Sun Nov 03, 2013 4:39 pm

This archive contain Facebook integration to MT hotspot with UM
You do not have the required permissions to view the files attached to this post.
 
ahmad210993
just joined
Posts: 16
Joined: Sun Mar 10, 2013 3:43 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Sun Nov 03, 2013 6:32 pm

This archive contain Facebook integration to MT hotspot with UM
Hello aleprolit, thank you for developing this script with PHP-PEAR2 and collaborating with user manager.
if you don't mind, can you re-upload this script using English? so every user in Forum Mikrotik can understand your file.
And one again, if you don't mind, I ask for your permission to put your name in my presentation on MUM-ID-2013 as the developers for Facebook Login Script. :D

Thank You.
 
aleprolit
just joined
Posts: 18
Joined: Thu Apr 11, 2013 11:36 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Thu Nov 07, 2013 6:07 pm

To ahmad210993.

Yes! I can translate script coments and other text.

You can be free to use this script and my name on MUM.

You already can use my scripts discussed in this forum branch:Automatically clean expired User-Manager accounts
( It must be usefull)

The script in archive code.rar have mistakes which corrected in next edition You can see below:

This script allow to activate registered demo account after actual-profile expired, and for security reasons use method POST instead of GET


api/login.php
<?php
$mac=$_POST['mac'];
$ip=$_POST['ip'];
$username=$_POST['username'];
if ($username === 'undefined') {
$username = '';
}
$linklogin=$_POST['link-login'];
$linkorig=$_POST['link-orig'];
$linkloginonly=$_POST['link-login-only'];
$chapid = $_POST['chap-id'];
$chapchallenge = $_POST['chap-challenge'];
//$chapid=clear($_POST['chap-id']);
//$chapchallenge=clear($_POST['chap-challenge']);
$linkorigesc=$_POST['link-orig-esc'];
$macesc=$_POST['mac-esc'];
$trial=$_POST['trial'];
$error=$_POST['error'];
function clear($code) { return str_replace('\\\\', '\\', $code); } 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Language' content='lt' />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="-1" />
<title>Free HotSpot | Login Facebook</title>
<link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon">
<link rel="icon" href="../images/favicon.ico" type="image/x-icon">
<link href="css/style.css" type="text/css" rel="stylesheet" />
<style type="text/css">
            .button
            {
            background: url(fb.png) no-repeat;
	    width: 100px;
		height: 30px;
            cursor:pointer;
                        border: none;
            }
        </style>
</head>
<body>
<div id="fb-root"></div>
<div id="user-info"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
 appId: '{YOUR API ID}',
 channelUrl : '//YOUR HOST NAME/api/channel.html',
 status: true,
 cookie: true,
 xfbml: true,
 oauth: true});
  function updateButton(response) {
    var button = document.getElementById('fb-auth');
    if (response.authResponse) {
      //user is already logged in and connected
      var userInfo = document.getElementById('user-info');
      FB.api('/me', function(response) {
old_pass = response.email; 
temp_pass = replace_string(old_pass,'@','A') ;
new_pass = replace_string(temp_pass,'.','T') ;
//    userInfo.innerHTML = '<iframe src="http://YOUR HOST NAME/api/user.php?mac=<?php echo $_POST['mac']; ?>&user=' + response.email + '&nama=' + response.name + '" width="1" height="1"></iframe>';
//   userInfo.innerHTML = '<iframe src="http://YOUR HOST NAME/api/user-um.php?mac=<?php echo $_POST['mac']; ?>&user=' + response.email + '&nama=' + response.name + '&password=' + new_pass + '" width="1" height="1"></iframe>';
document.useradd.user.value = response.email;
document.useradd.nama.value = response.name;
document.useradd.password.value = response.name;
document.useradd.submit();
			  wait(8000);
//self.location ='<?php echo $linkloginonly; ?>?dst=<?php echo $linkorig; ?>&password=' + response.name + '&username=' + response.email ;
document.login.username.value = response.email;
document.login.password.value = response.name;
document.login.submit()
});
      button.onclick = function() {
        FB.logout(function(response) {
          var userInfo = document.getElementById('user-info');
         userInfo.innerHTML="";
 });
      };
    } else {
      //user is not connected to your app or logged out
      button.onclick = function() {
        FB.login(function(response) {
   if (response.authResponse) {
            FB.api('/me', function(response) {
       var userInfo = document.getElementById('user-info');
     });   
          } else {
            //user cancelled login or did not grant authorization
          }
        }, {scope:'email'});   
      }
    }
  }
  // run once with current status and whenever the status changes
  FB.getLoginStatus(updateButton);
  FB.Event.subscribe('auth.statusChange', updateButton); 
};
(function() {
  var e = document.createElement('script'); e.async = true;
  e.src = document.location.protocol+ 'all.js';
  document.getElementById('fb-root').appendChild(e);
}());
function wait(msecs)
{
var start = new Date().getTime();
var cur = start
while(cur - start < msecs)
{
cur = new Date().getTime();
}	
};
function replace_string(txt,cut_str,paste_str)
{ 
var f=0;
var ht='';
ht = ht + txt;
f=ht.indexOf(cut_str);
while (f!=-1){ 
f=ht.indexOf(cut_str);
if (f>0){
ht = ht.substr(0,f) + paste_str + ht.substr(f+cut_str.length);
};
};
return ht
}
</script>
</center>
<div id="content">
<p><h4><font color="#000000">Hotspot Free with Facebook.</font></h4></p>
<button id="fb-auth" class="button"></button>
<br />
<br />
<font color="#000000" size="-1"><i>Working on pc/laptop</i></font><br />
<!-- $(if error) -->
<div style="color: #FF8080; font-size: 11px"><?php echo $error; ?></div>
<!-- $(endif) -->
</div>
<br />
<div id="footer">
<font color="#000000">Auksela Free Net © 2013.</font></a>
</div>
</div>
<!-- $(if chap-id) -->
	<form name="sendin" id="sendin" action="<?php echo $_POST['link-login-only']; ?>" method="post">
		<input type="hidden" name="username" />
		<input type="hidden" name="password" />
<!--
		<input type="hidden" name="error" />
-->
		<input type="hidden" name="dst" value="<?php echo $_POST['link-orig']; ?>" />
		<input type="hidden" name="popup" value="true" />
	</form>
	<script type="text/javascript" src="./md5.js"></script>
	<script type="text/javascript">
	<!--
	    function doLogin() {
                <?php if(strlen($chapid) < 1) echo "return true;\n"; ?>
		document.sendin.username.value = document.login.username.value;
		document.sendin.password.value = hexMD5('<?php echo $_POST['chap-id']; ?>' + document.login.password.value + '<?php echo $_POST['chap-challenge']; ?>');
		document.sendin.submit();
		return false;
	    }
	//-->
	</script>
<!-- $(endif) -->
<!-- removed $(if chap-id) $(endif)  around OnSubmit -->
	<form name="login" id="login" action="<?php echo $_POST['link-login-only'];?>" method="post" onSubmit="return doLogin()" >
		<input type="hidden" name="dst" value="<?php echo $_POST['link-orig']; ?>" />
		<input type="hidden" name="popup" value="true" />
<!--	
		<input type="hidden" name="error" value="<?php echo $_POST['error']; ?>" />
-->
        <input type="hidden" name="username" value=""/>
	    <input type="hidden" name="password" value=""/>
<!--			
        <input type="submit" value="Connect" />
-->
</form>
	<form name="useradd" id="useradd" action="user-um.php" method="post">
        <input type="hidden" name="user" value=""/>
		<input type="hidden" name="nama" value=""/>
		<input type="hidden" name="mac" value="<?php echo $_POST['mac']; ?>" />
	    <input type="hidden" name="password" value=""/>
<!--			
        <input type="submit" value="Connect" />
-->
</form>
// path below is commented , uncoment it if you want popup windows error.php which show links to register and activate permanent account
<!--
<script type="text/javascript">
<!--
var a = "<?php echo $_POST['error'] ?>";
if(a !== "")
{
window.open('http://YOUR HOST NAME/erros/error.php?mac=<?php echo $mac; ?>&link=<?php echo $linkloginonly; ?>&user=<?php echo $username; ?>&error=<?php echo $error; ?>','','width=500,height=350,scrollbars=yes');
}
//-->
<!--
</script>
-->
</body>
</html>
api/user-um.php

next edition...

<?php
namespace PEAR2\Net\RouterOS;
include_once '../src/php/PEAR2/Autoload.php';
include 'param.common.php';
//../include_once 'PEAR2_Net_RouterOS-1.0.0b3.phar';
?>
 <?php
$user=$_POST['user'];
$mac=$_POST['mac'];
$nama=$_POST['nama'];
//$password=md5(md5($_POST['user']));
//$password=$_POST['user'];
$password=$_POST['password'];
//$password=$_POST['nama'];
$txt1 = ' ';
$profile = 'Trial';
$location = 'Your location';
$location = $location.$txt1.$mac;
$customer = 'facebook';
$comment = $nama.$txt1.$mac;
$comment1 = 'Added by Facebook';
$client = new Client($host,$admin,$pass);
//------------------
 try {$printRequest = new Request('/system clock print');
//------
	$array=$client->sendSync($printRequest)->getAllArguments(array(
	'date' => 'date',
	'time'=> 'time'));
//------
$comment1 = $array['date'].$txt1.$array['time'].$txt1.$comment1;
$comment = $array['date'].$txt1.$array['time'].$txt1.$comment;
$printRequest = new Request('/tool user-manager user print');
	$printRequest->setQuery(Query::where('name',$user));
	$array=$client->sendSync($printRequest)->getAllArguments(array('.id' => '.id',
	'actual-profile' => 'actual-profile',
	'last-seen' => 'last-seen',
	'uptime-used' =>'uptime-used',
	'download-used' => 'download-used',
	'upload-used' => 'upload-used',
	'comment' => 'comment'));
//----
if (null !== $array['.id'] ) {
echo "User {$user} already registered in system!<br>";
if (null !== $array['actual-profile'] ) {
echo "User {$user} reached time limit!<br>";
} else {
//--- Reset counters
$setRequest = new Request('/tool user-manager user reset-counters');
$setRequest->setArgument('numbers',$array['.id']);
$client->sendSync($setRequest);
echo "All counters for {$user} Id {$array['.id']}successfully reseted!!!<br>";
//--- Create and activate profile
$addRequest = new Request('/tool user-manager user create-and-activate-profile');
$addRequest->setArgument('customer',$customer);
$addRequest->setArgument('numbers',$array['.id'] );
$addRequest->setArgument('profile',$profile);
$client->sendSync($addRequest);
//---add comment
$setRequest = new Request('/tool user-manager user comment');
$setRequest->setArgument('numbers',$array['.id']);
$setRequest->setArgument('comment',$comment1);
if ($client->sendSync($setRequest)->getType() !== Response::TYPE_FINAL) {
echo "Error when aactivated  '{$user}'.<br>";
} else {
echo "User {$user} successfully activated!!!<br>";
}
}
} else {
//--- Add user
$addRequest = new Request('/tool user-manager user add');
$addRequest->setArgument('customer', $customer);
$addRequest->setArgument('name', $user);
$addRequest->setArgument('first-name', $nama);
$addRequest->setArgument('last-name', $nama);
$addRequest->setArgument('location', $location);
$addRequest->setArgument('email', $user);
$addRequest->setArgument('password', $password);
$addRequest->setArgument('phone','370');
$addRequest->setArgument('disabled', no);
$addRequest->setArgument('comment', $comment);
$addRequest->setArgument('shared-users', 1);
if ($client->sendSync($addRequest)->getType() !== Response::TYPE_FINAL) {
echo "Error when added user for '{$nama}'.<br>";
} else {
echo "Comment: '{$comment}'. User'{$user}' successfully added!.";
}
//--- Create and activate profile
$printRequest = new Request('/tool user-manager user print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(Query::where('name', $user));
$userId = $client->sendSync($printRequest)->getArgument('.id');
$addRequest = new Request('/tool user-manager user create-and-activate-profile');
$addRequest->setArgument('customer', $customer);
$addRequest->setArgument('numbers', $userId );
$addRequest->setArgument('profile', $profile);
$client->sendSync($addRequest);
$setRequest = new Request('/tool user-manager user comment');
$setRequest->setArgument('numbers',  $userId );
$setRequest->setArgument('comment', $comment1);
if ($client->sendSync($setRequest)->getType() !== Response::TYPE_FINAL) {
echo "Error when aactivated  '{$user}'.<br>";
} else {
echo "Comment: '{$comment}'. User'{$user}' successfully added!!.";
echo "User {$user} successfully activated!!!<br>";
}
}
} catch(Exception $e) {
echo $e;
}
 ?>
errors/error.php

This page, in my case, show links to create, activate and check permanent user.

EXAMPLE
<?php
   $link=$_GET['link'];
   $error=$_GET['error'];
 ?>
<head>
<meta name="verify-webtopay" content="{Your pass in payment system}">
<meta http-equiv='Content-Language' content='lt' />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<link rel="stylesheet" type="text/css" href="css.css">
<font color=red size="5" ><b><?php echo $error; ?>!</b></font>
<br />
<font color=red><b>For permanent use online,</b></font>
<br> 
<font color=red><b>*1.</b></font>You must to create user, see link below,<br>
complete form and click "Add user".<br>
<font color=red><b>*2.</b></font>After user creation it must be activated: link<br>
"User activation", read all instruction and follow it.<br>
<font color=red><b>*3.</b></font>If If Your user already exist and you have no credits,<br>
follow link "Buy credits",<br>
read all instruction and follow it..<br />
<!--
<font color=red><b>Important!</b></font> If you do not use a long time, it is necessary to check <br>
account via a link on the bottom, <br>
as subscribers inactive over 60 days are removed from the system <br>
automatically. <br />
-->
<?php 

include "links.php";

?>
<body>
<script type="text/javascript" charset="utf-8">
                        	    var wtpQualitySign_projectId  = {YOUR ID IN PAYMENT SYSTEM};
                        	    var wtpQualitySign_language   = "lt";
                            	</script>
                            	<script src="https://www.webtopay.com/new/js/project/wtpQualitySigns.js" type="text/javascript" charset="utf-8"></script>
</body>
and

errors/links.php
<br>
<a href="#" style="text-decoration:none; font-family: Tahoma;" onclick="window.open('../reg/check-user.php?mac=<?php echo $_GET['mac'];?>&phone=Your phone number.','','width=500,height=420,scrollbars=yes');return false;" title="User add"><b style='color:white'>* User add.</b><br></a>
<a href="#" style="text-decoration:none; font-family: Tahoma;" onclick="window.open('./redirect.php?link=<?php echo $link; ?>&phone=Your phone number.','','width=500,height=420,scrollbars=yes');return false;" title="User add"><b style='color:white'>* Create automatic connection.</b><br></a>
<!--
<a href="#" style="text-decoration:none; font-family: Tahoma;" onclick="window.open('../check/index.php?phone=37000000000&user=<?php echo $_GET['user']; ?>','','width=500,height=420,scrollbars=yes');return false;" title="Check user"><b style='color:white'>* Check user.</b><br></a>
-->
<a href="#" style="text-decoration:none; font-family: Tahoma;" onclick="window.open('../payment/svitch.php?phone=37000000000&mac=<?php echo $_GET['mac'];?>&user=<?php echo $_GET['user'];?>','','width=500,height=420,scrollbars=yes');return false;" title="Activate user or Buy credit"> <b style='color:white'>* Activate user or Buy credit.</b> </a><br>
links in this example:

../reg/check-user.php
./redirect.php
../check/index.php
../payment/svitch.php

I dont explain for you how this links work. You can be free do this transaction yourself.

File error.txt - standart from MT.

You must create porofile "Trial" in UM.

File login/pclogin.php from archive code.rar - standard login.php file from mikrotik wiki - external login page.
To this file added this fragments (1,2,3,4):
//------1-----
Login by "Facebook":
<a href="#" style="text-decoration:none; font-family: verdana; color: #FF0000" onclick="select();return false;" title="Facebook."> Click here</a>
</p>
//-----1 end---
//-----2----
// and function select() - redirect non hotspot user ( external ) to another page insted facebook login
<script type="text/javascript">
<!--
function select()
{
var link = "<?php echo $_POST['link-login-only'] ?>";
if(link !== "")
{
document.redirect.submit();
} else {
window.open('/facebook.html','','width=500,height=350,scrollbars=yes');
}
}
//-->
</script>
//----2 end---
//----3-------
// and hidden form which call facebook login.php  page in directory apy
<form name="redirect" action="../api/login.php" method="post">
<input type="hidden" name="mac" value="<?php echo $_POST['mac']; ?>">
<input type="hidden" name="ip" value="<?php echo $_POST['ip']; ?>">
<input type="hidden" name="username" value="<?php echo $_POST['username']; ?>">
<input type="hidden" name="link-login" value="<?php echo $_POST['link-login']; ?>">
<input type="hidden" name="link-orig" value="<?php echo $_POST['link-orig']; ?>">
<input type="hidden" name="error" value="<?php echo $_POST['error']; ?>">
<input type="hidden" name="chap-id" value="<?php echo $_POST['chap-id']; ?>">
<input type="hidden" name="chap-challenge" value="<?php echo $_POST['chap-challenge']; ?>">
<input type="hidden" name="link-login-only" value="<?php echo $_POST['link-login-only']; ?>">
<input type="hidden" name="link-orig-esc" value="<?php echo $_POST['link-orig-esc']; ?>">
<input type="hidden" name="mac-esc" value="<?php echo $_POST['mac-esc']; ?>">
//------3 end---------
//------4------------
//this path open popup window if error occured and show useful links: create, activate and check permanent user. - see abow in my post.
<script type="text/javascript">
<!--
var a = "<?php echo $_POST['error'] ?>";
if(a !== "")
{
window.open('http://YOUR HOST NAME/errors/error.php?mac=<?php echo $mac; ?>&link=<?php echo $linkloginonly; ?>&user=<?php echo $username; ?>&error=<?php echo $error; ?>','','width=500,height=350,scrollbars=yes');
}
//-->
</script>
//-------4 end-------
I use login/moblogin.php and logun/pclogin.php files for automatic selection login from PC or mobile device, but it is another theme....

I think, my explanation enough to do it work.... :)

You can test it in our site Free Net

But external user redirected to error page insted Facebook login page.

P.S. In this version Facebook's user name used as password
and e-mail as username.
 
tkgit
Frequent Visitor
Frequent Visitor
Posts: 59
Joined: Sun Dec 23, 2012 8:32 am
Location: Dunedin, NZ
Contact:

Re: Integrating Facebook Connect with Hotspot Login / Authen

Mon Nov 11, 2013 12:24 am

can i use this method for trial user?
 
ahmad210993
just joined
Posts: 16
Joined: Sun Mar 10, 2013 3:43 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Mon Nov 11, 2013 12:29 am

can i use this method for trial user?
Yes you can. just create a user profile and make uptime limit for (example) 30 minutes. :D
 
kimdung
just joined
Posts: 3
Joined: Mon Nov 25, 2013 11:05 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Mon Nov 25, 2013 11:35 am

I have a problem about Walled Garden IP List, can you help me?
When add host http://www.facebook.com on Walled Garden IP List, Dst.Address receive the IP is 127.0.0.1. Meanwhile I not to be http://www.facebook.com

Image
 
kimdung
just joined
Posts: 3
Joined: Mon Nov 25, 2013 11:05 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Mon Nov 25, 2013 11:38 am

I have a problem about Walled Garden IP List, can you help me?
When add host http://www.facebook.com on Walled Garden IP List, Dst.Address receive the IP is 127.0.0.1. Meanwhile I not to be http://www.facebook.com

[url=http://upanh.com/view/?id=crc34wbcbwv]Image[/url
 
kimdung
just joined
Posts: 3
Joined: Mon Nov 25, 2013 11:05 am

Re: Integrating Facebook Connect with Hotspot Login / Authen

Mon Nov 25, 2013 11:40 am

I have a problem about Walled Garden IP List, can you help me?
When add host http://www.facebook.com on Walled Garden IP List, Dst.Address receive the IP is 127.0.0.1. Meanwhile I not to be http://www.facebook.com

[url=http://upanh.com/view/?id=crc34wbcbwv]Image[/url
 
ahmad210993
just joined
Posts: 16
Joined: Sun Mar 10, 2013 3:43 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Tue Dec 03, 2013 12:47 pm

Hey guys, I got some sneak peek from mobile version mikrotik hotspot with facebook login. :)
Image
Image

The script haven't complete yet.. need some more script to get data from facebook and do some api to mikrotik.
hope I can finish it before new year. :)

And some more update, on my php api script, there's something need to be corrected,
$READ = $API->read(false);
$ARRAY = $API->parse_response($READ);
print_r($ARRAY);



on bold part, need to add // on front of each line.
// $READ = $API->read(false);
// $ARRAY = $API->parse_response($READ);
// print_r($ARRAY);
$API->disconnect();

Also for Wallet Garden IP List, fortunately, it was easier to use Wallet Garden than Wallet Garden IP List,
Here some sample Wallet Garden from my router,
# SERVER METHOD DST-HOST DST-PORT PATH ACTION HITS
0 X ;;; place hotspot rules here allow 0
1 *.facebook.com allow 155
2 *.akamaihd.net allow 1
3 *.fbcdn.net allow 33
4 *.facebook.net allow 0
 
tkgit
Frequent Visitor
Frequent Visitor
Posts: 59
Joined: Sun Dec 23, 2012 8:32 am
Location: Dunedin, NZ
Contact:

Re: Integrating Facebook Connect with Hotspot Login / Authen

Sat Dec 14, 2013 1:42 am

does the router must have a public IP?
 
ahmad210993
just joined
Posts: 16
Joined: Sun Mar 10, 2013 3:43 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Sat Dec 14, 2013 1:48 am

does the router must have a public IP?
nope :)
 
tkgit
Frequent Visitor
Frequent Visitor
Posts: 59
Joined: Sun Dec 23, 2012 8:32 am
Location: Dunedin, NZ
Contact:

Re: Integrating Facebook Connect with Hotspot Login / Authen

Sat Dec 14, 2013 5:59 am

i think if use publik (external) web server/hosting, it's must have public IP, but if use internal web server (developed server in same local network), it isn't
 
pavloskaras
just joined
Posts: 1
Joined: Tue Dec 17, 2013 12:41 pm

Re: Integrating Facebook Connect with Hotspot Login / Authen

Tue Dec 17, 2013 1:00 pm

Hi to all
I am new to this forum. Please help me out with this.
I setup the hotspot service on mikrotik and I customize the login page by adding the facebook script for Like, the users have to like our page in order to get free internet. (This work ok)
The problem is with accounts that already like our site. You have to get data back from facebook.
I had an account in facebook developers site and I specify the ip of mikrotik (we have static public ip) and also the I made the port forwarding but the facebook can’t validate the connection.
I have try my code on a webserver which we have our webpage and it works fine. No certificate error.
How can allow facebook to validate the connection
OR
Can redirect users to my website to hit the like button and back to Mikrotik login page?


thanks in advance

Who is online

Users browsing this forum: DanielM1 and 74 guests