mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-09 04:32:44 -05:00
[PR #6205] [MERGED] Improve sso auth flow #7380
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/6205
Author: @Timshel
Created: 8/20/2025
Status: ✅ Merged
Merged: 12/6/2025
Merged by: @dani-garcia
Base:
main← Head:features/sso-db-code📝 Commits (1)
4ceb6abImprove sso auth flow📊 Changes
17 files changed (+449 additions, -295 deletions)
View changed files
📝
.env.template(+2 -2)➕
migrations/mysql/2025-08-20-120000_sso_nonce_to_auth/down.sql(+9 -0)➕
migrations/mysql/2025-08-20-120000_sso_nonce_to_auth/up.sql(+12 -0)➕
migrations/postgresql/2025-08-20-120000_sso_nonce_to_auth/down.sql(+9 -0)➕
migrations/postgresql/2025-08-20-120000_sso_nonce_to_auth/up.sql(+12 -0)➕
migrations/sqlite/2025-08-20-120000_sso_nonce_to_auth/down.sql(+9 -0)➕
migrations/sqlite/2025-08-20-120000_sso_nonce_to_auth/up.sql(+12 -0)📝
src/api/identity.rs(+53 -55)📝
src/config.rs(+2 -2)📝
src/db/mod.rs(+40 -0)📝
src/db/models/mod.rs(+2 -2)➕
src/db/models/sso_auth.rs(+134 -0)➖
src/db/models/sso_nonce.rs(+0 -87)📝
src/db/schema.rs(+5 -2)📝
src/main.rs(+4 -4)📝
src/sso.rs(+121 -125)📝
src/sso_client.rs(+23 -16)📄 Description
This PR make multiple modifications to the authentication flow:
codeorerror) in a JWT token to pass through Bitwarden redirection. Instead, it stores them in database and use thestateto find them again.The length of the JWT Token might have been causing issue with the desktop client and Chrome on Windows.
codeis the one which initiated the request (Either pass it to the provider or check it before calling it).Documentation which could be added to the wiki:
Login Flow
On
SSO_PKCEWhen activated the Bitwarden Clients PKCE code challenge are passed to the provider.
If disabled PKCE validation is still done before exchanging the code.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.