mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-05-23 08:32:45 -05:00
[GH-ISSUE #6465] Authentik session time limited to access token lifetime #11254
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?
Originally created by @controlaltnerd on GitHub (Nov 13, 2025).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/6465
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, ADMIN_TOKEN, SSO_ENABLED, SSO_CLIENT_ID, SSO_CLIENT_SECRET, SSO_AUTHORITY, SSO_AUTH_ONLY_NOT_SESSION
Config:
Vaultwarden Build Version
1.34.3-2ee40d61
Deployment method
Official Container Image
Custom deployment method
No response
Reverse Proxy
traefik 2.11
Host/Server Operating System
Linux
Operating System Version
Ubuntu 22.04.1
Clients
Web Vault, Browser Extension
Client Version
Chrome, Brave - v2025.10.1
Steps To Reproduce
Expected Result
Nothing should happen, and vault access should continue to be allowed (may require re-entering master password depending on whether testing via web or browser extension, and based on Vaultwarden config)
Actual Result
Session expires and SSO login is required again. Logs are generated stating that the
access token is close to expiration but we have no refresh token, while at the same time I can observe the refresh token in the browser and am able to verify with a JWT inspector that its contents are valid and not the same as that of the access token (as I've seen other issues note can happen).In my testing I've set access tokens to 10 minutes for expiration, to comply with the documentation indicating that 5 minutes is problematic. Refresh tokens are set to 30-day expiration.
I've also tested with
SSO_AUTH_ONLY_NOT_SESSIONset to both true and false, and it has no impact on the result. My best guess at the moment is that somehow the access token is being used in place of the refresh token. This seems similar to #6311 but different enough to warrant a new issue.Logs
Screenshots or Videos
Screenshot showing refresh token exists at the time a session expires:

Additional Context
No response
@Tyris commented on GitHub (Nov 25, 2025):
I was having this exact same issue, but after reviewing documentation, I think this was a configuration issue on my end.
Per https://integrations.goauthentik.io/security/vaultwarden/ (and https://integrations.goauthentik.io/security/vaultwarden/ ):
Adding the offline_access seems to have resolved this - (will keep testing, but looks good so far).
@controlaltnerd commented on GitHub (Nov 25, 2025):
@Tyris thanks, this seems to have fixed the issue with Vaultwarden thinking it doesn't have a refresh token. But then I got another error when it was time to refresh:
Failed to decode {IP_ADDRESS} refresh_token: ...Unable to refresh login credentials: Impossible to read refresh_token: Token has expiredTurned out that I also needed to add
offline_accesstoSSO_SCOPESso that Vaultwarden would request the token correctly. After that, I was able to confirm that refreshing works successfully on multiple devices.Also, I was wrong in my previous assessment of the refresh token. If
offline_accessisn't added to both Authentik andSSO_SCOPES, Authentik will return the access token wrapped in JSON that makes it look like a refresh token, but notably it will have anaccesskey instead of arefreshkey, with the value equal to that of the access token. I missed that the first time.Side note, logging could probably use some tweaking here, as successful refreshes are accompanied by logs such as:
which are confusing/distracting when looking for something indicating a successful refresh.