docker icon indicating copy to clipboard operation
docker copied to clipboard

Google OAuth - http redirect issue - ODOO 18.0

Open NOTORIOUSVR opened this issue 9 months ago • 7 comments
trafficstars

It seems that clicking on Connect your Gmail accout in odoo fails because of a 400: redirect_uri_mismatch error.

I have attempted everything in the documents however something isn't lining up and I do not believe it is my configuration.

HTTP > HTTPS redirect is working correctly on my site/server through my reverse proxy

reply from Google:


You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy.

If you're the app developer, register the redirect URI in the Google Cloud Console.
Request details: redirect_uri=http://myhostnamehere.com/google_gmail/confirm flowName=GeneralOAuthFlow
[Related developer documentation](https://developers.google.com/identity/protocols/oauth2/web-server#authorization-errors-redirect-uri-mismatch)

If I try to visit: http://myhostnamehere.com/google_gmail/confirm

I do get the FORBIDDEN error message - however I have updated the google plug in as described in the documentation and that hasn't fixed it. This is also a new installation so I would assume the latest plug in would have been installed.

Forbidden
You don't have the permission to access the requested resource. It is either read-protected or not readable by the server.

I am stuck unfortuantely at this point to understand how to move forward.

NOTORIOUSVR avatar Jan 25 '25 20:01 NOTORIOUSVR

Hey @NOTORIOUSVR I have also "such" problem, but with connecting using Keycloak. Check your URL after clicking log in with google (in my case with Keycloak).

In my URL https://accounts.odoo.com/web/login?scope=userinfo&mode=login&login=&redirect_hostname=http%3A%2F%2Flocalhost%3A8069&redirect=%2Foauth2%2Fauth%2F%3Fresponse_type%3Dtoken%26client_id%3D9ee01326-faa0-11ef-a681-ffce1fc1383b%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%253A8069%252Fauth_oauth%252Fsignin%26scope%3Duserinfo%26state%3D%257B%2522d%2522%253A%2B%2522main%2522,%2B%2522p%2522%253A%2B1,%2B%2522r%2522%253A%2B%2522http%25253A%25252F%25252Flocalhost%25253A8069%25252Fodoo%25253F%2522%257D I have redirect set to http://localhost:8069/oauth2/auth/ which isn't valid in my case. Beacause Odoo is hosted under different path.

I'm using Odoo in Docker.

rrakso avatar Mar 06 '25 17:03 rrakso

Dear,

Did you solve the problem? I got the same error.

Thank you in advanced,

psp-birt avatar Mar 19 '25 21:03 psp-birt

Hello, Anyone solved this issue? I am having the same issue in odoo.sh 17. Everything setup as instructed and always getting the 400: redirect_uri_mismatch

Thanks

batalhadematos avatar Apr 03 '25 09:04 batalhadematos

I doubt this has to do with odoo docker. Have you tried to set the following settings?

web.base.url.freeze = true web.base.url = https://your.odoo.tld

hertell avatar Apr 22 '25 17:04 hertell

I doubt this has to do with odoo docker. Have you tried to set the following settings?

web.base.url.freeze = true web.base.url = https://your.odoo.tld

Where are these settings to be added/changed?

NOTORIOUSVR avatar Apr 22 '25 17:04 NOTORIOUSVR

Under system parameters

hertell avatar Apr 23 '25 17:04 hertell

I am having the same issue.

In the error description from google I get the following description: redirect_uri=http:///google_account/authentication flowName=GeneralOAuthFlow which indicates that odoo is using the wrong url, namely http instead of https, as redirect_uri. In my parameters the web.base.url is set to https and the web.base.url.freeze is set to true

maunsen avatar Jun 13 '25 13:06 maunsen

I have same issue, with params:

[ir.config_parameter] web.base.url = https://odoo.mydomain.es web.base.url.freeze = True

I have installed the module server_environment_ir_config_parameter

Image

It shows http instead httpS

Image

sefirosweb avatar Jul 27 '25 16:07 sefirosweb

Exactly the same as above over here! While Odoo13 is still able to sync the Google Agenda but odoo18 (also running in docker on the same host) is sending the request with a http-URI instead of https.

Dax1900 avatar Aug 11 '25 20:08 Dax1900

@Dax1900 i fixed adding in the proxy X-Forwarded-Proto (cloudflare in my case)

sefirosweb avatar Aug 18 '25 18:08 sefirosweb