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

Add auth_oauth_ropc #493

Merged
merged 2 commits into from
Dec 19, 2023
Merged

Conversation

adrienpeiffer
Copy link
Contributor

@adrienpeiffer adrienpeiffer commented Mar 3, 2023

This module add the possibility to login with OAuth Resource Owner Password Credentials Grant

https://datatracker.ietf.org/doc/html/rfc6749#section-4.3

In most scenarios, more secure alternatives are available and recommended. This flow requires a very high degree of trust in the application, and carries risks that are not present in other flows. You should only use this flow when other more secure flows aren't viable.

This module is usefull for the Odoo mobile application, which only supports user/password authentication.

@adrienpeiffer adrienpeiffer force-pushed the 16.0-add-auth_azure_ropc-ape branch from 2c8499f to 6f41774 Compare March 3, 2023 15:15

https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth-ropc

Microsoft recommends you do not use the ROPC flow. In most scenarios, more secure alternatives are available and recommended. This flow requires a very high degree of trust in the application, and carries risks that are not present in other flows. You should only use this flow when other more secure flows aren't viable.
Copy link
Member

Choose a reason for hiding this comment

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

Actually, I think this is not specific to Azure. This looks like oauth2 Resource Owner Password Credentials Grant (aka Direct Access Grant in keycloak).

So you could perhaps rename it to auth_oauth_ropc, and give the Azure config as an example?

Also it might be worth mentioning why it is necessary in the README (i.e. the Odoo mobile app as you explained to me :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sbidoul Done

@adrienpeiffer adrienpeiffer force-pushed the 16.0-add-auth_azure_ropc-ape branch 2 times, most recently from a6b06d8 to 617d8b3 Compare June 5, 2023 09:45
if passwd_allowed and self.env.user.active:
ropc_providers = self.env["oauth.ropc.provider"].sudo().search([])
for conf in ropc_providers:
if conf._authenticate(self.env.user.login, password):
Copy link
Member

Choose a reason for hiding this comment

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

Sending the user/password to several providers is going to leak the credential to providers that should not receive them? I tend to think we should allow only one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch

@adrienpeiffer adrienpeiffer force-pushed the 16.0-add-auth_azure_ropc-ape branch 2 times, most recently from cad310c to e7925ba Compare June 6, 2023 11:04
@adrienpeiffer
Copy link
Contributor Author

@sbidoul Done

@adrienpeiffer adrienpeiffer force-pushed the 16.0-add-auth_azure_ropc-ape branch from e7925ba to 93f99f4 Compare June 6, 2023 11:06
@sbidoul sbidoul changed the title Add auth_azure_ropc Add auth_oauth_ropc Jul 1, 2023
Copy link

github-actions bot commented Nov 5, 2023

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 5, 2023
@github-actions github-actions bot closed this Dec 10, 2023
@adrienpeiffer
Copy link
Contributor Author

@OCA/server-environment-maintainers Could you reopen this one please ?

@adrienpeiffer
Copy link
Contributor Author

@sbidoul @lmignon

@sbidoul sbidoul reopened this Dec 19, 2023
@sbidoul
Copy link
Member

sbidoul commented Dec 19, 2023

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-493-by-sbidoul-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 0e25aec into OCA:16.0 Dec 19, 2023
7 of 8 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 83060f7. Thanks a lot for contributing to OCA. ❤️

@sbidoul sbidoul deleted the 16.0-add-auth_azure_ropc-ape branch February 14, 2024 07:40
SiesslPhillip pushed a commit to grueneerde/OCA-server-auth that referenced this pull request Nov 20, 2024
Syncing from upstream OCA/server-auth (14.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged 🎉 stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants