Repository navigation
[18.0][FIX] auth_oidc: use a single client authentication method on the token request - #1044
Open
SamyShaawat wants to merge 1 commit into
Open
SamyShaawat wants to merge 1 commit into
SamyShaawat wants to merge 1 commit into
Conversation
…en request The authorization code exchange sent `client_id` in the request body and, when a client secret is configured, also authenticated with HTTP Basic. A client must not use more than one authentication method per request (RFC 6749, section 2.3.1), and providers such as Nextcloud reject it with "Use exactly one client authentication method". * With a client secret, authenticate with HTTP Basic only. * Without client secret (public client using PKCE), send `client_id` in the body, as it is not authenticated otherwise.
Contributor
|
Hi @sbidoul, |
Author
|
@sbidoul could you please review this fix of the |
Author
|
CI note: the failing test jobs here are not caused by this change. The test database cannot be initialized because |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1037
Problem
The authorization code exchange sends
client_idin the request body and, whena client secret is configured, also authenticates with HTTP Basic. A client must
not use more than one authentication method per request (RFC 6749, 2.3.1), and
providers such as Nextcloud reject it:
Fix
client_secret_basic),without
client_idin the body.client_idin the body,as before.
Tests
test_token_request_confidential_clientandtest_token_request_public_clientcheck what is sent to the token endpoint in both cases. The first one fails
without the fix; the module suite passes on Odoo 18.0.
Not covered
The issue suggests making the method configurable (
client_secret_basicorclient_secret_post). This PR only removes the duplicate authentication andkeeps
client_secret_basic, which is what the module already sent.