Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

3

How to setup OpenERP V7 and google Oauth provider correctly ? [Closed]

By
Jeudy Nicolas
on 2/5/13, 4:05 PM 4,704 views

The Question has been closed

by
Jeudy Nicolas
on 07/23/2013 13:38:14

Hello,

I try to setup OpenERP V7 and google oauth2 authentication, but don't find the correct way to do this.

I create my app ID on code.google.com api console and put it in OpenERP setup, but I always have this traceback when trying to connect:

ERROR:openerp.addons.auth_oauth.controllers.main:OAuth2: %d format: a number is required, not str
Traceback (most recent call last):
  File "/opt/apps/openobject-addons/legacy/auth_oauth/controllers/main.py", line 63, in signin
    credentials = u.auth_oauth(cr, SUPERUSER_ID, provider, kw, context=context)
  File "/opt/apps/openobject-addons/legacy/auth_oauth/res_users.py", line 79, in auth_oauth
    login = self._auth_oauth_signin(cr, uid, provider, validation, params, context=context)
  File "/opt/apps/openobject-addons/legacy/auth_oauth_signup/res_users.py", line 42, in _auth_oauth_signin
    email = validation.get('email', 'provider_%d_user_%d' % (provider, oauth_uid))
TypeError: %d format: a number is required, not str

Hello.

I'm trying setting the Google Oauth with OpenERP too and I can't make it work.

What URIs you set in the API console?

With the following URLs doesn't work:

"https:// mydomain.com/oauth2callback", "https:// mydomain.com:8069/auth_oauth/signin" or "https:// mydomain.com"

Miguel Fernández
on 2/11/13, 5:13 AM

you have to use https://mydomain.com/auth_oauth/signin

Christophe Simonis (chs)
on 2/14/13, 4:36 PM

Thank you. I set the Google Oauth with this URL, but now I get the same traceback shown above.

Miguel Fernández
on 2/15/13, 4:33 AM
1

Martin

--Martin--
1978
| 5 6 8
Cornwall, Canada
--Martin--

Analysing, designing, coding and mentoring since 1975. Kilobytes to terabytes. Punch cards to punchy sites. My OpenERP video series: http://www.youtube.com/playlist?list=PLq7op4J183lX44ZlXPiHxUpRvmmRDtxye My Google Speadsheets --> OpenERP Data Pump project: http://martinhbramwell.github.io/GData_OpenERP_Data_Pump My email (with spaces removed) : mhb . warehouseman @ gmail . com

Martin
On 4/12/13, 9:42 AM

Nicholas,

I'm not sure what the root cause might be of your traceback, but I've done a lot of experimentation with this recently and made a video series about what I did :

OpenERP and Google

I hope you find it useful.

(It's new. Comments and suggestions gratefully received.)

Yes it is ok. My traceback come from mont ago and was a bug. So i think it's ok now

Tuxservices, Jeudy Nicolas
on 4/12/13, 11:22 AM
2

Look like a bug. It seems that the auth_oauth_signup module expect the UID returned by the OAuth provider to be a number, which we can be sure as it depend of the provider...

Can you please report the bug on launchpad?

It's allready done :). I think I will commit a patch tomorrow.

https://bugs.launchpad.net/openobject-addons/+bug/1118151

Tuxservices, Jeudy Nicolas
on 2/10/13, 3:00 PM

Hi I have same problem of redirect_uri_mismatch any clue on this?

Pragmatic
on 2/13/13, 3:34 AM
Olivier Dony (odo)
on 2/15/13, 7:01 AM

I can't get it work. Steps - Go to "https://code.google.com/apis/console/ - Ceate a new project - Go to Api Access - Create an oauth client_id - Edit settings and set both Authorized URIs to my hostname - copy paste client_id in "google oaut2" (oerp) Results: 1. Enter my site homepage 2. click on Log in with google 3. I'm redirected to google and asked to autorhize access to account information (I authorize access) 4. Error url: https://sagi.agrihold. message: authentitaction error

Juan José Scarafía
on 2/27/13, 9:59 AM

Also, I don't understand: 1. Where to link google account and OERP account 2. "auth_oauth": a. adds 3 fields to user model (and view) -> not shown. b. adds some fields to "general stettigs" -> not shown either 3. I've add them to the view and enter some value. Same result, it doesn't works.

One identified on "auth_oauth": a. res_user.py define "oauth_provider_id" field b. en res_user_view.xml it is call as "oauth_provider" (without the id)

Any help would be great. Thanks!

Juan José Scarafía
on 2/27/13, 10:13 AM
0
Miguel Fernández
On 2/6/13, 11:19 AM

Hello.

I'm trying setting the Google Oauth with OpenERP too and I can't make it work.

What URIs you set in the API console?

With the following URLs doesn't work:

"https:// mydomain.com/oauth2callback", "https:// mydomain.com:8069/auth_oauth/signin" or "https:// mydomain.com"

I'm sorry - this is not an answer. If you want to comment on the question, you can add comments just below it.

Daniel Reis
on 2/8/13, 7:55 PM
0
Javier Fuentes
On 2/7/13, 11:43 AM

Same problem here. Already reported in launchpad.

Miguel, I am using auth_oauth/signin in the API console.

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

6 follower(s)

Stats

Asked: 2/5/13, 4:05 PM
Seen: 4704 times
Last updated: 3/16/15, 8:10 AM