Add Vaultwarden OIDC Post#7347
Open
puria wants to merge 1 commit into
Open
Conversation
Collaborator
|
This of course will break providers that do not support this. |
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.
Problem
Vaultwarden SSO uses the
openidconnectcrate which defaults to HTTP Basic Auth (client_id:client_secretin theAuthorizationheader) for token endpoint requests.Stalwart Mail Server's OIDC provider only accepts client credentials as
client_idandclient_secretPOST body parameters — it does not support the Basic Auth header method. This causes the token exchange to fail when using Stalwart as the OIDC identity provider for Vaultwarden SSO.Fix
Set
.set_auth_type(openidconnect::AuthType::RequestBody)on the client, so credentials are sent asapplication/x-www-form-urlencodedPOST body parameters instead of in theAuthorizationheader.This is consistent with RFC 6749 Section 2.3.1 which says clients using the "client password" authentication method may include credentials in the request body. The
openidconnectcrate supports both methods — the fix simply selects the one that Stalwart (and other providers that follow the body-only convention) expects.Testing
Tested with Stalwart OIDC as the identity provider. Token exchange succeeds after this change where it previously failed with an authentication error.
🤖 Generated with Claude Code