mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-07-24 09:13:27 -05:00
[GH-ISSUE #7151] SSO with Microsoft Entra ID fails when UPN differs from email (login loops back to start) #30120
Reference in New Issue
Block a user
Originally created by @shuysmans on GitHub (Apr 28, 2026).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/7151
Prerequisites
Vaultwarden Support String
Your environment (Generated via diagnostics page)
Config & Details (Generated via diagnostics page)
Show Config & Details
Environment settings which are overridden: DOMAIN, SIGNUPS_ALLOWED, ADMIN_TOKEN
Config:
Vaultwarden Build Version
1.35.7
Deployment method
Official Container Image
Custom deployment method
No response
Reverse Proxy
/
Host/Server Operating System
Linux
Operating System Version
Rocky Linux v10.1
Clients
Web Vault
Client Version
No response
Steps To Reproduce
Expected Result
Login succeeding giving access to the the vault
Actual Result
Entra ID login succeeds
OIDC token exchange succeeds
User is created and visible in /admin
Login audit / mail notifications are sent
After redirect to Vaultwarden, the UI returns to the start/login screen
No Vaultwarden error is shown in the UI
Logs
Screenshots or Videos
No response
Additional Context
In our tenant, UPN and primary email address are different:
preferred_username / UPN: user@tenant.onmicrosoft.com
Email (mail attribute): firstname.lastname@organisation.tld
Vaultwarden appears to only associate SSO users based on the email claim, while Entra ID uses UPN (preferred_username) as the primary identifier.
When UPN ≠ email:
SSO authentication succeeds
User creation succeeds
Session association fails
User is redirected back to the login screen
There is no configuration option in Vaultwarden to:
Use UPN as identifier
Map preferred_username to email
Select a different claim for user binding