open-webui/backend/open_webui
root 0fe0fcff4d fix: Add proactive OAuth token refresh for MCP sessions
Add a background task that periodically refreshes OAuth tokens before
they expire, preventing users from having to re-authenticate when MCP
OAuth tokens (like Notion) expire after 1 hour.

Changes:
- Add get_expiring_sessions() method to OAuthSessionTable to query
  sessions expiring within a specified time window
- Enhance OAuthClientManager._perform_token_refresh() to handle
  unregistered MCP clients by discovering OAuth info from stored
  tool server config
- Add periodic_oauth_token_refresh() background task that runs every
  5 minutes and refreshes tokens expiring within 10 minutes
- Start the background task in app lifespan with proper cleanup

Fixes #19809
2025-12-08 18:29:07 +11:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal refactor: format 2025-08-10 22:28:31 +08:00
migrations refac 2025-12-02 11:00:34 -05:00
models fix: Add proactive OAuth token refresh for MCP sessions 2025-12-08 18:29:07 +11:00
retrieval refac/fix: docling auth 2025-12-06 08:06:42 -05:00
routers fix: add missing env var parameter pass through for enable async embedding (#19748) 2025-12-04 14:59:09 -05:00
socket refac 2025-11-30 14:51:44 -05:00
static refac 2025-08-10 00:02:58 +04:00
storage refac/fix: s3 checksum validation 2025-08-21 12:44:16 +04:00
test chore: format, lint 2025-07-16 15:23:18 +09:00
utils fix: Add proactive OAuth token refresh for MCP sessions 2025-12-08 18:29:07 +11:00
__init__.py Update __init__.py 2025-04-15 09:55:35 +02:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py feat: new OAUTH_AUDIENCE config (#19768) 2025-12-06 10:45:34 -05:00
constants.py feat/enh: optional password validation 2025-11-20 17:44:49 -05:00
env.py fix: ENABLE_CHAT_RESPONSE_BASE64_IMAGE_URL_CONVERSION env var 2025-11-25 04:15:41 -05:00
functions.py refac: user valves 2025-09-26 17:49:42 -05:00
main.py fix: Add proactive OAuth token refresh for MCP sessions 2025-12-08 18:29:07 +11:00
tasks.py 0.6.33 (#18118) 2025-10-07 16:20:27 -05:00