This article describes how to customize Geo2Tag for using Google OAuth. The setting takes place in two stages. At first the corresponding record should be created at https://console.developers.google.com/, then parameters of record should be added to config.ini.
Setting in Google Developer Console
- At https://console.developers.google.com/start press the button “Enable Google APIs for use in your apps”.
2. In the appeared window enter the name of project, click the check box and press Create.
3. Next you need press the button“Enable Google APIs for use in your apps” again, after that a window with dropbox of projects will appear.
5. On the next page in the left menu press “API & auth /Credentials“.
“ Create new Client ID“.
- Into the field “Authorized redirect URIs” you should specify the link: https://<domain name of the host>/<prefix (by default instance)>/login/google/authorized. If you don’t know your prefix you can find out its value in the file var/www/geomongo/config.ini, parameter instance_prefix.
As the result you should get approximately like this window.
Settings in config.ini
For futher setting you need to open the file /var/www/geomongo/config.ini with any text editor and edit (add if the section didn’t exist earlier) the section “Google_OAuth” by the next way (on the basis of data from the last screenshot in previous section):
[Google_OAuth] GOOGLE_CLIENT_ID=<field Client ID> GOOGLE_CLIENT_SECRET=<field Client secret> GOOGLE_REDIRECT_URL=<link from Authorized redirect URIs>
For testing you need to:
- follow the link /<Prefix>/login,
- press the button “Sign in with Google”,
- enter login and password,
- accept usage API (the next image),
- after that you will be redirected to the page “/instance/login/google/authorized?” where “Success” will be displayed.