[ This post is no longer valid, please see the updated documentation in www.spotipo.com/help ]
I have seen quite a number people asking for enabling Facebook Login in unifi for hotspot landing pages. This is not trivial thing to do as Unifi doesn’t support walled garden, and a user needs to have connection to Facebook to complete his/her login.
I have added a work around for this in Unifispot framework, once a user express interest for login via Facebook, he/she has given temporary internet access for 5mins during which he has to complete the Login for further access.
Procedure for enabling Facebook Login
- First step is to create a facebook app by giving your portal domain.Note that FB login can be used only if the portal is associated with a domain name, IP based URLs are not allowed by facebook. Follow this link to get further details
- Note down APP ID and Secret after creating the app.
- Install the dependencies
sudo apt-get install python python-dev apache2 libapache2-mod-wsgi git python-pip
4.Clone the repository
git clone https://github.com/unifispot/unifispot-free.git unifispot
5. Install all the python modules and initialize sqlite database
pip install -r requirements.txt
6. Initilize sqlite databse
chmod +x rebuild.sh
chown -R www-data:www-data /var/www/unifispot
7. Now edit the configuration file and add unifi controller details as well as FB App details.
#Need to modify the following values
unifihost : '127.0.0.1' #No need to change as controller is in the same machine
unifiadmin : 'ubnt' #Modify with admin username for controller
unifipass : 'ubnt' #Modify with admin password
unifisiteid : 'qnao074x' #Change this value to site ID
fbappid : '' #FB APP ID
fbappname : '' #Name of your app
fbappsecret : '' #FB App secret
8. Now that portal is configured, we need to configure apache2 to server this portal. Create a filenamed unifispot.conf in /etc/apache2/sites-available with below content. Be sure to configure the domain name correctly.
WSGIDaemonProcess unifispot user=www-data group=www-data threads=5
WSGIScriptAlias / /var/www/unifispot/unifispot.wsgi
Allow from all
CustomLog /var/www/unifispot/access.log combined
9. Enable site and restart apache2 service
service apache2 restart
#if you haven't disabled the default apache site 000-default execute the below commands
service apache2 restart
Thats about it!. You can test the portal by going to the below URL
To configure your unifi site to use the portal change Guest control settings as follows.
Now login to your guest network and you should be seeing a landing page as below.
If you face any issues in configuring facebook login in unifi, do let me know via comments.