mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #12376] [MERGED] feat: Add option to disable OAuth profile pictures #22905
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/12376
Author: @MushroomLamp-COB
Created: 4/3/2025
Status: ✅ Merged
Merged: 4/3/2025
Merged by: @tjbck
Base:
dev← Head:main📝 Commits (1)
548c7f1Added OAUTH_USE_PICTURE_CLAIM env var📊 Changes
2 files changed (+47 additions, -34 deletions)
View changed files
📝
backend/open_webui/config.py(+6 -0)📝
backend/open_webui/utils/oauth.py(+41 -34)📄 Description
Pull Request Description
This PR adds a new configuration option OAUTH_USE_PICTURE_CLAIM that allows administrators to toggle whether OAuth profile pictures are used or if the default user.png avatar is used instead. This addresses issue #12325, providing a simple way to disable the use of profile pictures from OAuth providers.
Changelog Entry
Description
Added a new environment variable and configuration option to control whether profile pictures from OAuth providers are used or if the default avatar is used instead. This provides administrators with greater control over user avatars in their Open WebUI deployment.
Added
Added OAUTH_USE_PICTURE_CLAIM environment variable and corresponding PersistentConfig entry
Added conditional logic in oauth.py to respect this setting when processing user profile pictures
Changed
Modified the OAuth authentication flow to check the new configuration option before attempting to fetch and process profile pictures
Fixed
Fixes #12325: Added option to turn off the use of profile pictures from OAuth claims
Additional Information
This change is minimal and focused on providing administrators with greater control over avatar usage. The default setting is True, which maintains backward compatibility with existing behavior.
Tested on a docker, expected functionality for True, False, and not specified values.
(this is my first time doing a PR, hopefully this is ok)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.