Skip to content
Snippets Groups Projects
Commit ad25c9ec authored by Xavier Morel's avatar Xavier Morel
Browse files

[FIX] auth_oauth: google rejects nonce if response_type=token


I apparently missed this case in #88871: Google's legacy
flow (response_type=token) explicitly rejects a `nonce` parameter
being passed in the authentication request. The nonce parameter is
only accepted for an OIDC-conformant implicit flow request (aka
`response_type=token id_token`).

The specific endpoint doesn't seem to have any bearing on this, v1 and
v2 authentication endpoints result in the same behavior.

Drawback: Okta isn't supported anymore, as it requires the nonce, no
if, no but, even on "legacy" auth requests, possibly others. However
since these already weren't supported that's considered less of an
issue than possibly breaking compatibility with existing IDP.

Rejected alternative: adding `id_token` to the `response_type` to come
closer to OIDC-conformant request, however that was considered too
risky: Odoo clients could be using legacy IDP which also reject the
nonce parameter but don't have a magic "OIDC conformant" trigger.

closes odoo/odoo#91466

X-original-commit: 1fd738d9
Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: default avatarOlivier Dony <odo@odoo.com>
parent 2a101c13
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ class OAuthLogin(Home):
redirect_uri=return_url,
scope=provider['scope'],
state=json.dumps(state),
nonce=base64.urlsafe_b64encode(os.urandom(16)),
# nonce=base64.urlsafe_b64encode(os.urandom(16)),
)
provider['auth_link'] = "%s?%s" % (provider['auth_endpoint'], werkzeug.urls.url_encode(params))
return providers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment