Skip to content

Commit 7689f2b

Browse files
committed
Document OAuth session handling, video permission and permission notes for 0.13.4
Covers which OAuth sessions the session limit removes and what signing out does to stored sessions, tool servers that need a sign-in when the SSO session is gone, the Video Generation permission (off by default) and the AUTOMATIC1111 checkpoint note in the permissions table. The environment reference is bundled because the split is by whole file.
1 parent c239cad commit 7689f2b

5 files changed

Lines changed: 59 additions & 348 deletions

File tree

‎docs/features/authentication-access/auth/sso/index.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ To solve issues related to large tokens (e.g., with AD FS group claims exceeding
8888

8989
1. **Server-Side Storage:** Instead of storing large `access_token` and `id_token` values in browser cookies, the entire token payload is now encrypted and stored securely in the Open WebUI database in a new `oauth_session` table.
9090
2. **Secure Session Cookie:** The user's browser is sent a single, small, and secure `httponly` cookie named `oauth_session_id`. This cookie acts as an opaque identifier, containing no sensitive information itself.
91-
3. **Multi-Device Support:** Multiple concurrent sessions are supported per user per provider. Logging in from a second device (e.g., mobile) does **not** invalidate the first device's session. To prevent unbounded session growth, a configurable limit (`OAUTH_MAX_SESSIONS_PER_USER`, default: 10) prunes the oldest sessions when exceeded.
91+
3. **Multi-Device Support:** Multiple concurrent sessions are supported per user per provider. Logging in from a second device (e.g., mobile) does **not** invalidate the first device's session. To prevent unbounded session growth, a configurable limit (`OAUTH_MAX_SESSIONS_PER_USER`, default: 10) removes the oldest sessions, by last sign-in or token refresh, when exceeded. Signing out removes the stored session of that browser, unless it is the person's only one for that provider.
9292
4. **Automatic Refresh:** When a token is required by a downstream service (like a tool or an OpenAI-compatible endpoint), the backend uses the `oauth_session_id` to retrieve the tokens. If the tokens are expired or close to expiring, the system automatically uses the stored `refresh_token` to fetch new ones from the provider before forwarding them. This ensures services always receive a valid token and prevents silent failures. When several requests hit an expiring token at once, it is refreshed only once: with Redis configured, a per-session lock covers every worker and replica, and without Redis the lock covers one process. This keeps sessions working with providers that rotate refresh tokens, which reject the second refresh.
9393
5. **Clean Token Access:** This architecture provides a clean and reliable way for internal tools and other services to access user tokens without fragile cookie-scraping.
9494

‎docs/features/authentication-access/rbac/permissions.md‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ Controls access to broad platform capabilities.
142142
| **Encrypted Channels** | Ability to use [encrypted chats](/features/channels/encrypted-chats) in direct messages and private group channels ([`USER_PERMISSIONS_FEATURES_ENCRYPTED_CHANNELS`](/reference/env-configuration#user_permissions_features_encrypted_channels)). Also needs **Channels**. Off by default. |
143143
| **Folders** | Ability to use folders for organizing chats. |
144144
| **Web Search** | Ability to use Web Search integration. |
145-
| **Image Generation** | Ability to use Image Generation tools. On backends that keep only one image model loaded at a time, this also allows changing the instance's active image model; see the note below. |
145+
| **Image Generation** | Ability to use Image Generation tools. With Model IDs set on an AUTOMATIC1111 connection, this also allows switching the server's loaded model for everyone; see the note below. |
146+
| **Video Generation** | Ability to use [video generation](/features/chat-conversations/image-generation-and-editing/video-generation) ([`USER_PERMISSIONS_FEATURES_VIDEO_GENERATION`](/reference/env-configuration#user_permissions_features_video_generation)). Off by default. Admins always have it. The switch shows while video generation is enabled. |
146147
| **Code Interpreter** | Ability to use the Python Code Interpreter. Manual code execution (the **Run** button on code blocks) has no permission of its own; it follows [`ENABLE_CODE_EXECUTION`](/reference/env-configuration#enable_code_execution) for everyone. See [Manual Code Execution](/features/chat-conversations/chat-features/code-execution/python#manual-code-execution-pyodide). |
147148
| **Memories** | Access to the Memories feature for persistent user context. Taking it away hides the **Personalization** settings tab, blocks the memory API endpoints, withholds the memory tools from the model and stops stored memories being injected into the chat's system context. The injection check runs server-side on every chat request, so a client that still asks for memory does not get it. Admins are always exempt. |
148149
| **Automations** | Ability for non-admin users to access the Automations page and create, edit, run, pause, or delete their own scheduled automations. Anyone who can edit a folder can also pause the automations that post into it. See [Folders](/features/chat-conversations/chat-features/automations#folders). |
@@ -152,11 +153,9 @@ Controls access to broad platform capabilities.
152153

153154
:::info Image Generation and the Active Model
154155

155-
Some image backends, such as Automatic1111, keep a single image model loaded and generate with whichever one is active, so selecting a model is the same action as switching the loaded one.
156+
AUTOMATIC1111 keeps a single checkpoint loaded and generates with whichever one is active. When an AUTOMATIC1111 connection has **Model IDs** set, a user who has access to the connection and picks a model that is not the loaded one switches the loaded checkpoint for everyone using that server until it is switched again. Leave **Model IDs** empty to prevent this.
156157

157-
On Automatic1111 that switch is restricted to administrators. A non-admin with **Features > Image Generation** cannot change the instance-wide model: their model selection is ignored and the image is generated on the currently configured checkpoint. Only an administrator's request changes the active model, and when it does, it changes it for everyone until it is changed again.
158-
159-
Backends that accept a model with each request are not affected: a user's choice applies only to their own generation.
158+
Other connection types accept a model with each request, so a user's choice applies only to their own generation. Which connections a user can use is set by the connection's **Access Control** in [Image Generation](/features/chat-conversations/image-generation-and-editing#set-up-a-connection).
160159

161160
:::
162161

‎docs/features/extensibility/plugin/tools/openapi-servers/open-webui.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ Clicking this icon opens a popup where you can:
115115
- Expand an MCP server to load its tool names and descriptions live
116116
- Check whether each server is connected or shows **Auth required**, and use **Reconnect** to sign in again
117117

118+
Tool servers that forward the person's SSO token (**System OAuth**) show as needing a sign-in under **+ > Tools** once that SSO session is gone. Picking one takes the person to the sign-in page.
119+
118120
To disconnect OAuth for an MCP server, use **Disconnect OAuth** next to the tool under **+ > Tools** in the message input.
119121

120122
Here's what the tool information modal looks like:

‎docs/reference/database-schema.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ Things to know about the notification table:
975975

976976
Things to know about the oauth_session table:
977977

978-
- The relationship to `user` is one-to-many. Each sign-in inserts a new row, so several rows can exist for the same user and the same provider. `OAUTH_MAX_SESSIONS_PER_USER` (default 10) caps how many a user may hold per provider; on sign-in the oldest rows above the cap are deleted.
978+
- The relationship to `user` is one-to-many. Each sign-in inserts a new row, so several rows can exist for the same user and the same provider. `OAUTH_MAX_SESSIONS_PER_USER` (default 10) caps how many a user may hold per provider; on sign-in the oldest rows above the cap, by last sign-in or token refresh, are deleted.
979979
- Indexed on `user_id`, on `expires_at` and on (`user_id`, `provider`) (`idx_oauth_session_user_id`, `idx_oauth_session_expires_at`, `idx_oauth_session_user_provider`, all from migration `38d63c18f30f`).
980980
- Deleting a user cascades to delete their sessions.
981981
- `token` holds the provider's token set (access token, ID token and refresh token) as JSON, encrypted at rest with Fernet before it is written and decrypted on read. The key comes from `OAUTH_SESSION_TOKEN_ENCRYPTION_KEY`, which falls back to `WEBUI_SECRET_KEY`. A key that is not already 44 characters is hashed with SHA-256 and base64-encoded to the length Fernet requires.

0 commit comments

Comments
 (0)