[GH-ISSUE #8619] bug: [SSO] When the OAuth provider does not provide the 'userinfo' in the token field, the backend will raise an exception instead of evaluating it as None in subsequent code. #15199

Closed
opened 2026-04-19 21:28:22 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @Tryanks on GitHub (Jan 16, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8619

Installation Method

git clone

Environment

  • Open WebUI Version: dev branch in commit 0425621494

Confirmation:

  • I have read and followed all the instructions provided in the README.md.

Description

At oauth.py#L203, the program directly indexes the key userinfo from the token and later checks if not user_data:.
The issue here is that if the OAuth provider does not provide the 'userinfo' field (for example, GitHub only provides access_token), the program will not proceed to the next step but will instead crash, displaying an internal error on the webpage.
The fix is to modify it to:

user_data: UserInfo = token.get("userinfo")
Originally created by @Tryanks on GitHub (Jan 16, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/8619 ## Installation Method git clone ## Environment - **Open WebUI Version:** dev branch in commit 0425621494b3c2385fa672c372fce070b6b8d89e **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. ## Description At [oauth.py#L203](https://github.com/open-webui/open-webui/blob/4269df041fef62208d59babe0faae866d2bfbc3c/backend/open_webui/utils/oauth.py#L203), the program directly indexes the key `userinfo` from the token and later checks `if not user_data:`. The issue here is that if the OAuth provider does not provide the 'userinfo' field (for example, GitHub only provides `access_token`), the program will not proceed to the next step but will instead crash, displaying an internal error on the webpage. The fix is to modify it to: user_data: UserInfo = token.get("userinfo")
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#15199