-
-
Notifications
You must be signed in to change notification settings - Fork 492
[18.0][IMP]auth_oidc: verify self-signed certificates #837
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
base: 18.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,10 +46,23 @@ class AuthOauthProvider(models.Model): | |
| string="Token URL", help="Required for OpenID Connect authorization code flow." | ||
| ) | ||
| jwks_uri = fields.Char(string="JWKS URL", help="Required for OpenID Connect.") | ||
| self_signed = fields.Boolean( | ||
| string="Self-signed", | ||
| help="Disable certificate checks for server to server token requests " | ||
| "when using self signed certificates.", | ||
| ) | ||
| self_signed_verify = fields.Char( | ||
| string="Self-signed verify path", | ||
| help="Path to the self-signed certificate for the verification process. " | ||
| "Empty value disables the verification.", | ||
ChristophAbenthungCibex marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would name this field
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me the benefit here would be that this is only for one OAuth server connection while REQUESTS_CA_BUNDLE is for all requests from Odoo to other servers. |
||
|
|
||
| @tools.ormcache("self.jwks_uri", "kid") | ||
| def _get_keys(self, kid): | ||
| r = requests.get(self.jwks_uri, timeout=10) | ||
| verify = True | ||
| if self.self_signed: | ||
| verify = self.self_signed_verify or False | ||
| r = requests.get(self.jwks_uri, timeout=10, verify=verify) | ||
| r.raise_for_status() | ||
| response = r.json() | ||
| # the keys returned here should follow | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this does not make it sufficiently clear that this enables an insecure option. Could we name this field, say, "insecure" like curl does?