mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[GH-ISSUE #23234] feat: Configurable maximum lifespan for OAuth sessions #19926
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 @lorenzophys on GitHub (Mar 30, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23234
Check Existing Issues
Verify Feature Scope
Problem Description
We are using OpenID Connect OAuth for our Open WebUI deployment. Our corporate identity provider enforces short-lived access tokens, so we rely on the refresh token mechanism (
offline_accessscope +OAUTH_REFRESH_TOKEN_INCLUDE_SCOPE=true) to maintain user sessions.This works well for keeping users logged in, but it creates a new problem: sessions effectively never expire. This doesn't align with our corporate security requirements, which mandate that user sessions have a finite maximum duration regardless of activity.
Desired Solution you'd like
A new configuration option (e.g.
OAUTH_SESSION_MAX_LIFETIME) that defines the absolute maximum lifespan of an OAuth session from the moment of initial login.I'm not familiar enough with the codebase to try to implement it myself
Alternatives Considered
No response
Additional Context
No response
@Classic298 commented on GitHub (Apr 3, 2026):
Thanks for the detailed write-up! I wanted to check: have you tried configuring JWT_EXPIRES_IN (environment variable or admin panel) to your desired max session duration (e.g., 8h, 1d)?
This controls how long the Open WebUI session token lasts regardless of OAuth token state. Once the JWT expires, the user would need to re-authenticate through the OAuth flow. The default is 4w (4 weeks), which may be why sessions feel like they never expire.
If you've already tried this and are still seeing sessions persist beyond the configured duration, it would be helpful to know the specific behavior that would point to a genuine gap that a new OAUTH_SESSION_MAX_LIFETIME setting would need to address.
@garrettashcroft1231-max commented on GitHub (Apr 3, 2026):
Thanks for the suggestion! I haven’t tried adjusting JWT_EXPIRES_IN
yet—this might actually cover our use case.
On Fri, Apr 3, 2026, 3:20 PM Classic298 @.***> wrote: