Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][IMP] webservice: add support for oauth2 authentication #41

Open
wants to merge 4 commits into
base: 15.0
Choose a base branch
from

Conversation

gurneyalex
Copy link
Member

No description provided.

@OCA-git-bot
Copy link
Contributor

Hi @etobella,
some modules you are maintaining are being modified, check this out!

@gurneyalex gurneyalex changed the title [IMP] webservice: allow web application flow for oauth2 [IMP] webservice: add support for oauth2 authentication Apr 19, 2024
@gurneyalex gurneyalex force-pushed the 15.0-oauth2 branch 2 times, most recently from ab05ccf to 29f624c Compare April 24, 2024 12:06
@gurneyalex gurneyalex marked this pull request as ready for review April 24, 2024 12:07
@gurneyalex
Copy link
Member Author

see also #35

@gurneyalex gurneyalex added this to the 15.0 milestone Apr 26, 2024
@gurneyalex gurneyalex changed the title [IMP] webservice: add support for oauth2 authentication [15.0][IMP] webservice: add support for oauth2 authentication Apr 26, 2024
Allow using oauth2 with Backend Application Flow / Client Credentials
Grant.
Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

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

LG. The fix on the onchange has to be back/fwd ported? If yes, I'd recommend splitting it in its own commit.

The use of a compute method on `oauth2_flow` when this field is touched by
the server environment mixin causes it to be defined twice as computed,
with differents settings, and this ultimately causes a warning message
in the logs:

```
WARNING odoo odoo.modules.registry: webservice.backend: inconsistent 'compute_sudo' for computed fields: protocol, url, auth_type, username, password, api_key, api_key_header, oauth2_flow, oauth2_clientid, oauth2_client_secret, oauth2_token_url, oauth2_authorization_url, oauth2_audience, oauth2_scope, content_type
```

We fix this by using an old fashioned onchange declaration on the
`auth_type` field.
@gurneyalex
Copy link
Member Author

LG. The fix on the onchange has to be back/fwd ported? If yes, I'd recommend splitting it in its own commit.

You are right.

Forward ported to 16. 0 on #47 by the way

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.

3 participants