mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[PR #22619] [CLOSED] fix(oauth): sync group membership for admin users #42414
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22619
Author: @gambletan
Created: 3/12/2026
Status: ❌ Closed
Base:
main← Head:fix/oauth-admin-group-sync📝 Commits (1)
63713f7fix(oauth): sync group membership for admin users📊 Changes
1 file changed (+1 additions, -4 deletions)
View changed files
📝
backend/open_webui/utils/oauth.py(+1 -4)📄 Description
Summary
user.role != "admin"guard inoauth.pythat preventedupdate_user_groupsfrom being called for admin usersENABLE_OAUTH_GROUP_MANAGEMENT=true, group membership is now synced from the OAuth provider for all users including admins, on every loginFixes #22527
Root cause
In
OAuthManager.handle_callback, after the JWT token is created, group sync was conditionally skipped for admin users:The
user.role != "admin"condition has no documented rationale and directly contradicts the expected behavior: admins should also have their OAuth group memberships reflected in Open WebUI.Test plan
ENABLE_OAUTH_GROUP_MANAGEMENT=true— groups still sync correctlyENABLE_OAUTH_GROUP_MANAGEMENT=false— no group sync for any user (unchanged)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.