Skip to content

Conversation

@augusto-weiss
Copy link
Contributor

No description provided.

@augusto-weiss augusto-weiss force-pushed the 18.0-mig-oauth_provider branch from 4dc1dee to 0e37c3d Compare August 6, 2025 15:29
@augusto-weiss augusto-weiss force-pushed the 18.0-mig-oauth_provider branch from 14650fb to d734261 Compare August 19, 2025 19:08
Sylvain GARANCHER and others added 28 commits September 1, 2025 21:19
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 18.0-mig-oauth_provider branch from d734261 to 8d4bb3b Compare September 1, 2025 21:20
Copy link

@P-H-Phuc P-H-Phuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @augusto-weiss, I’ve suggested some changes for improving the authorization validation and opened a adhoc-dev/server-auth/pull#1 on your repo. Let me know what you think or if you have any ideas for further improvements.

augusto-weiss and others added 2 commits September 24, 2025 16:55
[IMP] oauth_provider: get access_token from headers, remove werkzeug.wrappers.BaseResponse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants