This question has been flagged
6 Replies
17922 Views

Important: Make sure Odoo is correctly configured to send email before starting this tutorial. Odoo will need to email an activation link when you enable OAUTH.
So, let’s get started.


Enabling OAuth Support in Odoo
1. Login to Odoo as the Administrator 
2. Browse to Settings -> Configuration -> General Settings:
3.  □ Allow external users to sign up ->check this
4. Template user for new users created through signup must be Template User.


Enabling Google App Engine Admin Console
1. Browse to https://admin.google.com and login as the Google domain adminstrator 
2. Click More Controls at the bottom of the page 
3. Click More Google Apps 
4. Click the X next to Filter: Top featured services to clear the filter 
5. Scroll down the list and click Google App Engine Admin Console 
6. Turn it ON for everyone 


Create Google Apps OAuth2 access for Odoo
1. Browse to https://console.developers.google.com/project and if necessary login 
2. Click Create Project 
3. In Project Name enter whatever you want, e.g. odoo
4. Click Create 
5. In the menu on the left, expand APIs & auth then click Credentials 
6. Click Create new Client ID 
7. Under Authorized JavaScript origins enter your server domain name, e.g. http://mydomain.com 
8. Under Authorized redirect URI enter you domain plus the OAUTH path, e.g. http://mydomain.com/auth_oauth/signin 
9. Click Create client ID 
10. In the menu click Consent screen 
11. Select an email address from the drop down menu 
12. In Product Name enter a description, e.g. odoo
13. Click Save 
14. In the menu click Credentials and leave the browser window open 


Add Google OAuth2 credentials to Odoo
1. Login to Odoo as the Administrator 
2. Browse to Settings -> OAuth Providers 

Note : If you don't found OAuth Providers, Please go to General Settings and check the checkbox of Use external authentication providers of authentication.

3. Click Odoo.com Accounts to open the settings window 
4. Click Edit then uncheck the Allowed checkbox 
5. Click Save then click Providers to return to the list 
6. Click Google OAuth2 to open the settings window 
7. Click Edit 
8. From the Google Developers Console, copy and paste the Client ID into the box in Odoo 
9. Check the Allowed checkbox 
10. Click Save 

Avatar
Discard

Good Explaination..!

when i select database and click to login with google it shows Error Access Denied. don't allow to login with email id and password. also question is login with google allow to directly login with email and password or user need to first sign up and then user can login?

Best Answer

Following this, gives you the option to use googleauth. The problem is that if you select this option, users who dont have a google account, do not have access to register without google. 

It would be nice, if both options could be used. With Google, facebook or just regular template user.

Avatar
Discard
Author

Hello JA, In odoo authentication your need is already satisfied. To use both the options like sign up with template user or google user you have to just got to Setting->General Settings and check checkbox Allow external users to sign up in Portal access.

Best Answer

In this program, I have one problem when using https:// as default protocol, the "request.httprequest.url_root" from controllers/main.py sending out http:// return_uri, so, the program keep said it "Error: redirect_uri_mismatch" error. So, what can be done? I try to modified the main.py to use "web.base.url" but keep getting the following error:

File "/opt/odoo/addons/bus/bus.py", line 188, in poll

raise Exception("bus.Bus unavailable")"

And the system was lock at 500 error.

So, anyone can share the possible solution will be appreciated.

Avatar
Discard
Author

Are you running your odoo instance using odoo.py or in openerp-gevent mode or openerp-server mode? If you are using openerp-server mode, Please try running server using odoo.py Please check the odoo dependencies installation.

Best Answer

I think there are some mistake on this line.

Under Authorized redirect URI enter you domain plus the

OAUTH path, e.g. http://mydomain.com/auth_oauth/signin

Should change to

http://mydomain.com/openerp.wsgi/auth_oauth/signin

At least that is how I got it working on odoo 8

Avatar
Discard
Best Answer

Following this, gives you the option to use googleauth. The problem is that if you select this option, users who dont have a google account, do not have access to register without google. 

It would be nice, if both options could be used. With Google, facebook or just regular template user.

Avatar
Discard