mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-05 18:38:17 -05:00
[PR #9751] [MERGED] Fix: Setting OAUTH_USERNAME_CLAIM has no effect on username for user during oauth signup #22415
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/9751
Author: @pseudorm
Created: 2/10/2025
Status: ✅ Merged
Merged: 2/10/2025
Merged by: @tjbck
Base:
dev← Head:bug/user-signup/fix-oauth-username-claim-has-no-effect📝 Commits (3)
db0a12fcheck name is none1b6e12aadd warning336d1d9Merge branch 'dev' into bug/user-signup/fix-oauth-username-claim-has-no-effect📊 Changes
1 file changed (+2 additions, -1 deletions)
View changed files
📝
backend/open_webui/utils/oauth.py(+2 -1)📄 Description
The
OAUTH_USERNAME_CLAIMenvironment variable currently does not affect the choice of username for users who signed up through OAuth.This is due to a bug that sets the username to be the email if there's no user found on the DB with the same
sub, when in fact there should not be such user on DB during first sign up.Instead of checking if there's a user, this PR checks if there's a key matching value of
OAUTH_USERNAME_CLAIMin theuser_dataOAuth client response, email is only used when such key is not found.Fixes open-webui/open-webui#9753
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.