From c8be0b20ccdd2784fcb300a0f217961a9327fbdf Mon Sep 17 00:00:00 2001 From: Rodrigo Agundez Date: Wed, 15 Jan 2025 09:17:22 +0800 Subject: [PATCH 1/2] Add functionality to retrive picture for microsoft oauth --- backend/open_webui/utils/oauth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/utils/oauth.py b/backend/open_webui/utils/oauth.py index c76a1453b..ba2880f36 100644 --- a/backend/open_webui/utils/oauth.py +++ b/backend/open_webui/utils/oauth.py @@ -255,7 +255,9 @@ class OAuthManager: raise HTTPException(400, detail=ERROR_MESSAGES.EMAIL_TAKEN) picture_claim = auth_manager_config.OAUTH_PICTURE_CLAIM - picture_url = user_data.get(picture_claim, "") + picture_url = user_data.get( + picture_claim, OAUTH_PROVIDERS[provider].get("picture_url", "") + ) if picture_url: # Download the profile image into a base64 string try: From 32f121f0197f4939f6fd4f99576fc403cccb0d09 Mon Sep 17 00:00:00 2001 From: Rodrigo Agundez Date: Wed, 15 Jan 2025 09:18:16 +0800 Subject: [PATCH 2/2] Add functionality to retrive picture for microsoft oauth --- backend/open_webui/config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index a48b2db05..f9794bccc 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -487,6 +487,7 @@ def load_oauth_providers(): "server_metadata_url": f"https://login.microsoftonline.com/{MICROSOFT_CLIENT_TENANT_ID.value}/v2.0/.well-known/openid-configuration", "scope": MICROSOFT_OAUTH_SCOPE.value, "redirect_uri": MICROSOFT_REDIRECT_URI.value, + "picture_url": "https://graph.microsoft.com/v1.0/me/photo/$value", } if (