fbpx

We will learn about the steps by steps how can we login odoo using google,

1. setup google oauth2 – for login using google account , u have to activate your GCP billing and then enable the google API,
https://developers.google.com/adwords/api/docs/guides/authentication#webapp (take note: using webapp )
–> after you get your page …
On the page that appears, copy the client ID and client secret to your clipboard, as you will need them when you configure your client library.

2. then you setup odoo , installed the oauth_ module and then
–> setup the oauth providers, for V12, it is at General setting–>Oauth Authentication –> OAuth Providers,
setup one record for google if it is not there … but for mine, v12, odoo , i had to change it to
— Authentication URL : https://accounts.google.com/o/oauth2/auth
— Scope : https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
— Validation URL : https://www.googleapis.com/oauth2/v1/tokeninfo
— Data URL : https://www.googleapis.com/oauth2/v1/userinfo

and over at google GCP console , we need…
To update the authorized redirect URIs,
visit: https://console.developers.google.com/apis/credentials/oauthclient/${your_client_id}?project=${your_project_number}
replace the ${your_client_id} and ${your_project_number} with your relavant service account ‘s credential , client_id and then
your_project_number is the project_id. ( have tested as at 2021-02-15 , working)

I have to change the Authorised redirect URIs to http://besihat.com/auth_oauth/signin before it can work.

after that i can login to odoo using my google account.