Skip to content

[19.0][MIG] oauth_provider: Migration to 19.0 - #1022

Draft
augusto-weiss wants to merge 32 commits into
OCA:19.0from
adhoc-dev:19.0-mig-oauth_provider-v2
Draft

augusto-weiss wants to merge 32 commits into
OCA:19.0from
adhoc-dev:19.0-mig-oauth_provider-v2

Conversation

@augusto-weiss

Copy link
Copy Markdown

Migration of oauth_provider to 19.0.

Supersedes #853 (closed as stale), rebased on current 19.0 and without the unrelated auth_signup_verify_email commits (handled in #905).

Sylvain GARANCHER and others added 28 commits October 1, 2026 10:58
OCA Transbot updated translations from Transifex

OCA Transbot updated translations from Transifex

OCA Transbot updated translations from Transifex

OCA Transbot updated translations from Transifex

OCA Transbot updated translations from Transifex

OCA Transbot updated translations from Transifex

[UPD] Update oauth_provider.pot
Lines removed tries to write on `client_id` attribute of the
`oauth.provider.client` which do not have such an attribute.
Theses sentences seams useless, so I removed it.
This module uses the method `get_frontend_session_info()` from
`ir.http`, and this method is defined in the web module.
The bug is introduced by commit d46db56.

The oauth.provider.client model is used to fill the `request.client`
field in the _load_client() method of the OdooValidator class.

The oauthlib python library need that the `client` object set in the `request`
by the OdooValidator must contain an attribute named `client_id` which must
contain the identifier of the oauth.provider.client. In other words the
`client_id` attribute of the `client` object must contain the
`client_id` that is posted by the HTTP request to the server.
Source here:
https://github.com/oauthlib/oauthlib/blob/dab6a5ae1830ddd8a79c1e9687f63508eae60b57/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py#L471-L474

The client_id was previously not part of the `oauth.provider.client`
odoo model because it conflict in term of nomenclature with the odoo way
of defining fields name. So it was added on the fly after for the record
given to the oauthlib.

Now, its not allowed to add such field like this, and doing that without
explanation is quite confusing.

So now the field with a name that breaks the Odoo nomenclature is added
with a comment so that we can understand the exception done here.
@augusto-weiss
augusto-weiss force-pushed the 19.0-mig-oauth_provider-v2 branch from e67b351 to f9244fa Compare November 17, 2026 13:59
@oca-cla-bot

oca-cla-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants