mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-14 13:25:20 +00:00
feat: enable user groups sync with Entra
This commit is contained in:
parent
e15a864301
commit
ed65cf8871
1 changed files with 6 additions and 3 deletions
|
|
@ -535,12 +535,15 @@ async def signin(request: Request, response: Response, form_data: SigninForm):
|
||||||
|
|
||||||
user = Auths.authenticate_user_by_email(email)
|
user = Auths.authenticate_user_by_email(email)
|
||||||
if WEBUI_AUTH_TRUSTED_GROUPS_HEADER and user and user.role != "admin":
|
if WEBUI_AUTH_TRUSTED_GROUPS_HEADER and user and user.role != "admin":
|
||||||
group_names = request.headers.get(
|
groups_header_value = request.headers.get(WEBUI_AUTH_TRUSTED_GROUPS_HEADER, "")
|
||||||
WEBUI_AUTH_TRUSTED_GROUPS_HEADER, ""
|
log.info(f"Groups header value: {groups_header_value}")
|
||||||
).split(",")
|
group_names = groups_header_value.split(",")
|
||||||
group_names = [name.strip() for name in group_names if name.strip()]
|
group_names = [name.strip() for name in group_names if name.strip()]
|
||||||
|
log.info(f"Group names: {group_names}")
|
||||||
|
|
||||||
if group_names:
|
if group_names:
|
||||||
|
Groups.create_groups_by_group_names(user.id, group_names)
|
||||||
|
log.info(f"Syncing groups for user {user.id} - {user.email}: {group_names}")
|
||||||
Groups.sync_groups_by_group_names(user.id, group_names)
|
Groups.sync_groups_by_group_names(user.id, group_names)
|
||||||
|
|
||||||
elif WEBUI_AUTH == False:
|
elif WEBUI_AUTH == False:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue