This article describes how to configure Geo2Tag for using Facebook OAuth. The configuring takes place in two stages. First you need to create a new application in the interface of Developers.Facebook, then to set parameters for authorization in configuration file of Geo2Tag: config.ini.
Creation and setting app in Developers.Facebook
- Create a new app in portal https://developers.facebook.com
- Skip the help window Quick Start using the button “Skip Quick Start” in order to proceed to information about the application.
- Go to the tab Settings, here there are necessary data for authorization: App ID; AppSecret;
- Also you have to specify Site URL and App Domains as stated above (for local testing authorization)
- Then go to the tab Advanced. Permission to connect via OAuth is enabled by default so everything you need is to specify link https://<domain name of the host>/<prefix (by default instance)>/login/facebook/authorized in the field “Valid OAuth Redirect URL’s“. If you don’t know your prefix you can find its value in the file /var/www/geomongo/config.ini, parameter instance_prefix.
- Further go to the tab Status & Review and set switch to position YES in front of the text: Do you want to make this app and all its live features available to the general public?
For further setting you should to open the file /var/www/geomongo/config.ini in any text editor and change the section (add if this section didn’t exist previously) “Facebook_OAuth” as follows:
FACEBOOK_CLIENT_ID=<Data from the field "App ID"> FACEBOOK_CLIENT_SECRET=<Data from the field "App Secret"> FACEBOOK_REDIRECT_URL=<Links from "Valid OAuth Redirect URL's">
For testing you need to:
- follow the link /<Prefix>/login,
- press the button “Sign in with Facebook”,
- enter login and password,
- allow the using API,
- after that you will be redirected to the page “/instance/login/facebook/authorized?”where the text “Success” will be showed.