[GH-ISSUE #8319] OIDC Login Fails with 500 Error Pydantic ValidationError on Missing 'name' Field #134808

Closed
opened 2026-05-25 01:02:56 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @karllee830 on GitHub (Jan 4, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8319

Bug Report

Installation Method

Docker

Environment

  • Open WebUI Version: v0.5.1
  • Operating System: Windows 11
  • Browser (if applicable): Chrome 131.0.6778.205

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

Users should be able to successfully log in to Open WebUI using OIDC authentication, even if the OIDC provider doesn't explicitly provide a user's full name. If no name is provided in the OIDC response, a default name should be used or handled gracefully without causing an error.
When the name field is empty, username should be used as the name.

Actual Behavior:

When attempting to log in with OIDC, the login process fails with a 500 Internal Server Error if the OIDC provider does not return a name field (or similar field) in its response. This results in the inability to log in.

Description

Bug Summary:
OIDC login fails due to a Pydantic validation error when the user's name field is missing in the OIDC response. This is caused by the UserModel requiring a non-null string for the name attribute.

Reproduction Details

Steps to Reproduce:

  1. Configure Open WebUI to use OIDC for authentication.
  2. Use an OIDC provider that does not include a user's name field (or a field that would map to user's name) in the ID token response or userinfo endpoint response.
  3. Initiate the OIDC login process by navigating to the Open WebUI login page.
  4. Complete the authentication flow with the OIDC provider.
  5. After the OIDC provider redirects back to Open WebUI with the authorization code, the authentication process will fail, and you will receive a 500 error.
  6. Inspect the Docker container logs. You'll see a traceback with a pydantic_core._pydantic_core.ValidationError for the UserModel, specifically indicating the name field is missing.

Logs and Screenshots

Docker Container Logs:

INFO:     ***.***.***.***:0 - "GET /oauth/oidc/login HTTP/1.1" 302 Found
INFO  [open_webui.models.auths] insert_new_auth
INFO:     ***.***.***.***:0 - "GET /oauth/oidc/callback?code=*************************************************&state=***********************&iss=https%3A%2F%2Flogin.********.com%2Foidc HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
  + Exception Group Traceback (most recent call last):
  |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
  |     yield
  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in **call**
  |     async with anyio.create_task_group() as task_group:
  |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 815, in **aexit**
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
    |     result = await app(  # type: ignore[func-returns-value]
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in **call**
    |     return await self.app(scope, receive, send)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in **call**
    |     await super().__call__(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in **call**
    |     await self.middleware_stack(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in **call**
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in **call**
    |     await self.app(scope, receive, _send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/sessions.py", line 85, in **call**
    |     await self.app(scope, receive, send_wrapper)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in **call**
    |     await self.app(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call**
    |     with collapse_excgroups():
    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit**
    |     self.gen.throw(typ, value, traceback)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call**
    |     response = await self.dispatch_func(request, call_next)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/open_webui/main.py", line 716, in inspect_websocket
    |     return await call_next(request)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    |     raise app_exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    |     await self.app(scope, receive_or_disconnect, send_no_error)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call**
    |     with collapse_excgroups():
    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit**
    |     self.gen.throw(typ, value, traceback)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call**
    |     response = await self.dispatch_func(request, call_next)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/open_webui/main.py", line 695, in check_url
    |     response = await call_next(request)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    |     raise app_exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    |     await self.app(scope, receive_or_disconnect, send_no_error)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call**
    |     with collapse_excgroups():
    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit**
    |     self.gen.throw(typ, value, traceback)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call**
    |     response = await self.dispatch_func(request, call_next)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/open_webui/main.py", line 685, in commit_session_after_request
    |     response = await call_next(request)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    |     raise app_exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    |     await self.app(scope, receive_or_disconnect, send_no_error)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call**
    |     with collapse_excgroups():
    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit**
    |     self.gen.throw(typ, value, traceback)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call**
    |     response = await self.dispatch_func(request, call_next)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/open_webui/utils/security_headers.py", line 11, in dispatch
    |     response = await call_next(request)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    |     raise app_exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    |     await self.app(scope, receive_or_disconnect, send_no_error)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call**
    |     with collapse_excgroups():
    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit**
    |     self.gen.throw(typ, value, traceback)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call**
    |     response = await self.dispatch_func(request, call_next)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/open_webui/main.py", line 674, in dispatch
    |     response = await call_next(request)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    |     raise app_exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    |     await self.app(scope, receive_or_disconnect, send_no_error)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in **call**
    |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    |     await app(scope, receive, sender)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in **call**
    |     await self.middleware_stack(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
    |     await route.handle(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
    |     await self.app(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
    |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    |     await app(scope, receive, sender)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
    |     response = await func(request)
    |                ^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
    |     raw_response = await run_endpoint_function(
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    |     return await dependant.call(**values)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/open_webui/main.py", line 1105, in oauth_callback
    |     return await oauth_manager.handle_callback(provider, request, response)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/open_webui/utils/oauth.py", line 284, in handle_callback
    |     user = Auths.insert_new_auth(
    |            ^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/open_webui/models/auths.py", line 118, in insert_new_auth
    |     user = Users.insert_new_user(
    |            ^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/open_webui/models/users.py", line 103, in insert_new_user
    |     user = UserModel(
    |            ^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/pydantic/main.py", line 212, in **init**
    |     validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | pydantic_core._pydantic_core.ValidationError: 1 validation error for UserModel
    | name
    |   Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    |     For further information visit https://errors.pydantic.dev/2.9/v/string_type
    +------------------------------------
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in **call**
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in **call**
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in **call**
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in **call**
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in **call**
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/sessions.py", line 85, in **call**
    await self.app(scope, receive, send_wrapper)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in **call**
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call**
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit**
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call**
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/main.py", line 716, in inspect_websocket
    return await call_next(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call**
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit**
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call**
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/main.py", line 695, in check_url
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call**
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit**
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call**
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/main.py", line 685, in commit_session_after_request
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call**
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit**
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call**
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/utils/security_headers.py", line 11, in dispatch
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call**
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit**
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call**
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/main.py", line 674, in dispatch
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in **call**
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in **call**
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/main.py", line 1105, in oauth_callback
    return await oauth_manager.handle_callback(provider, request, response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/utils/oauth.py", line 284, in handle_callback
    user = Auths.insert_new_auth(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/auths.py", line 118, in insert_new_auth
    user = Users.insert_new_user(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/models/users.py", line 103, in insert_new_user
    user = UserModel(
           ^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pydantic/main.py", line 212, in **init**
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for UserModel
name
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.9/v/string_type
INFO:     connection closed

Screenshots/Screen Recordings (if applicable):
image

Additional Information

The issue seems to be related to the way Open WebUI handles user creation during the OIDC login process. The UserModel in /app/backend/open_webui/models/users.py expects a valid string for the name field, and if this field is missing from the OIDC provider's response, a validation error occurs, causing the login process to fail. This could be fixed by either using username as name or having Open WebUI generate a default name in cases when the name is not returned by OIDC.

Note

If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!

Originally created by @karllee830 on GitHub (Jan 4, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/8319 # Bug Report ## Installation Method Docker ## Environment - **Open WebUI Version:** v0.5.1 - **Operating System:** Windows 11 - **Browser (if applicable):** Chrome 131.0.6778.205 **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I am on the latest version of both Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: Users should be able to successfully log in to Open WebUI using OIDC authentication, even if the OIDC provider doesn't explicitly provide a user's full name. If no name is provided in the OIDC response, a default name should be used or handled gracefully without causing an error. **When the name field is empty, username should be used as the name.** ## Actual Behavior: When attempting to log in with OIDC, the login process fails with a 500 Internal Server Error if the OIDC provider does not return a `name` field (or similar field) in its response. This results in the inability to log in. ## Description **Bug Summary:** OIDC login fails due to a Pydantic validation error when the user's `name` field is missing in the OIDC response. This is caused by the `UserModel` requiring a non-null string for the `name` attribute. ## Reproduction Details **Steps to Reproduce:** 1. Configure Open WebUI to use OIDC for authentication. 2. Use an OIDC provider that does not include a user's name field (or a field that would map to user's name) in the ID token response or userinfo endpoint response. 3. Initiate the OIDC login process by navigating to the Open WebUI login page. 4. Complete the authentication flow with the OIDC provider. 5. After the OIDC provider redirects back to Open WebUI with the authorization code, the authentication process will fail, and you will receive a 500 error. 6. Inspect the Docker container logs. You'll see a traceback with a `pydantic_core._pydantic_core.ValidationError` for the `UserModel`, specifically indicating the `name` field is missing. ## Logs and Screenshots **Docker Container Logs:** ``` INFO: ***.***.***.***:0 - "GET /oauth/oidc/login HTTP/1.1" 302 Found INFO [open_webui.models.auths] insert_new_auth INFO: ***.***.***.***:0 - "GET /oauth/oidc/callback?code=*************************************************&state=***********************&iss=https%3A%2F%2Flogin.********.com%2Foidc HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application + Exception Group Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups | yield | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in **call** | async with anyio.create_task_group() as task_group: | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 815, in **aexit** | raise BaseExceptionGroup( | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi | result = await app( # type: ignore[func-returns-value] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in **call** | return await self.app(scope, receive, send) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in **call** | await super().__call__(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in **call** | await self.middleware_stack(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in **call** | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in **call** | await self.app(scope, receive, _send) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/sessions.py", line 85, in **call** | await self.app(scope, receive, send_wrapper) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in **call** | await self.app(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call** | with collapse_excgroups(): | File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit** | self.gen.throw(typ, value, traceback) | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call** | response = await self.dispatch_func(request, call_next) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/open_webui/main.py", line 716, in inspect_websocket | return await call_next(request) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next | raise app_exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call** | with collapse_excgroups(): | File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit** | self.gen.throw(typ, value, traceback) | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call** | response = await self.dispatch_func(request, call_next) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/open_webui/main.py", line 695, in check_url | response = await call_next(request) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next | raise app_exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call** | with collapse_excgroups(): | File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit** | self.gen.throw(typ, value, traceback) | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call** | response = await self.dispatch_func(request, call_next) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/open_webui/main.py", line 685, in commit_session_after_request | response = await call_next(request) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next | raise app_exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call** | with collapse_excgroups(): | File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit** | self.gen.throw(typ, value, traceback) | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call** | response = await self.dispatch_func(request, call_next) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/open_webui/utils/security_headers.py", line 11, in dispatch | response = await call_next(request) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next | raise app_exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call** | with collapse_excgroups(): | File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit** | self.gen.throw(typ, value, traceback) | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call** | response = await self.dispatch_func(request, call_next) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/open_webui/main.py", line 674, in dispatch | response = await call_next(request) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next | raise app_exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in **call** | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app | await app(scope, receive, sender) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in **call** | await self.middleware_stack(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app | await route.handle(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle | await self.app(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app | await wrap_app_handling_exceptions(app, request)(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app | await app(scope, receive, sender) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app | response = await func(request) | ^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app | raw_response = await run_endpoint_function( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function | return await dependant.call(**values) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/open_webui/main.py", line 1105, in oauth_callback | return await oauth_manager.handle_callback(provider, request, response) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/open_webui/utils/oauth.py", line 284, in handle_callback | user = Auths.insert_new_auth( | ^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/open_webui/models/auths.py", line 118, in insert_new_auth | user = Users.insert_new_user( | ^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/open_webui/models/users.py", line 103, in insert_new_user | user = UserModel( | ^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/pydantic/main.py", line 212, in **init** | validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | pydantic_core._pydantic_core.ValidationError: 1 validation error for UserModel | name | Input should be a valid string [type=string_type, input_value=None, input_type=NoneType] | For further information visit https://errors.pydantic.dev/2.9/v/string_type +------------------------------------ During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in **call** return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in **call** await super().__call__(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in **call** await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in **call** raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in **call** await self.app(scope, receive, _send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/sessions.py", line 85, in **call** await self.app(scope, receive, send_wrapper) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in **call** await self.app(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call** with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit** self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call** response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/main.py", line 716, in inspect_websocket return await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call** with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit** self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call** response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/main.py", line 695, in check_url response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call** with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit** self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call** response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/main.py", line 685, in commit_session_after_request response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call** with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit** self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call** response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/utils/security_headers.py", line 11, in dispatch response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in **call** with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in **exit** self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in **call** response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/main.py", line 674, in dispatch response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in **call** await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in **call** await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/main.py", line 1105, in oauth_callback return await oauth_manager.handle_callback(provider, request, response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/utils/oauth.py", line 284, in handle_callback user = Auths.insert_new_auth( ^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/auths.py", line 118, in insert_new_auth user = Users.insert_new_user( ^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/models/users.py", line 103, in insert_new_user user = UserModel( ^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pydantic/main.py", line 212, in **init** validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pydantic_core._pydantic_core.ValidationError: 1 validation error for UserModel name Input should be a valid string [type=string_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.9/v/string_type INFO: connection closed ``` **Screenshots/Screen Recordings (if applicable):** ![image](https://github.com/user-attachments/assets/b7963e1c-30f2-4392-8e44-6d79d5669cfa) ## Additional Information The issue seems to be related to the way Open WebUI handles user creation during the OIDC login process. The `UserModel` in `/app/backend/open_webui/models/users.py` expects a valid string for the `name` field, and if this field is missing from the OIDC provider's response, a validation error occurs, causing the login process to fail. This could be fixed by either using username as name or having Open WebUI generate a default name in cases when the name is not returned by OIDC. ## Note If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
GiteaMirror added the enhancementgood first issuehelp wanted labels 2026-05-25 01:03:24 -05:00
Author
Owner

@tjbck commented on GitHub (Jan 5, 2025):

PR Welcome here!

<!-- gh-comment-id:2571456373 --> @tjbck commented on GitHub (Jan 5, 2025): PR Welcome here!
Author
Owner

@annatech commented on GitHub (Jan 9, 2025):

I can confirm this issue as well. I currently have this implemented with OneLogin as the oidc provider. Testing if configuring oidc to return a "name" field in the response will bypass this bug.

<!-- gh-comment-id:2580295942 --> @annatech commented on GitHub (Jan 9, 2025): I can confirm this issue as well. I currently have this implemented with OneLogin as the oidc provider. Testing if configuring oidc to return a "name" field in the response will bypass this bug.
Author
Owner

@annatech commented on GitHub (Jan 9, 2025):

Tested by including name in the oidc response and confirmed that name is included in the OAUTH_SCOPES list. The same issue persists. I suspect here that the error is baked into the code, requiring a PR to fix it.

<!-- gh-comment-id:2580330656 --> @annatech commented on GitHub (Jan 9, 2025): Tested by including name in the oidc response and confirmed that name is included in the OAUTH_SCOPES list. The same issue persists. I suspect here that the error is baked into the code, requiring a PR to fix it.
Author
Owner

@kyunwang commented on GitHub (Jan 12, 2025):

Been trying to reproduce this issue but unable to do so.
Having looked into to the code, the default value User should have taken over if the name property was not in the response.
Or in the off chance that the provider returned the name field as a different type, such as a number.

Tested with few scenarios and the default value is taken over as expected.

Below is the example user info returned by the provider which does not contain any name or related information. And uses the fallback as expected.

Example user info returned by provider
{
    "sub": "string",
    "email": "my-email@example.com",
    "ver": 1,
    "iss": "https://<provider>/oauth2/default",
    "aud": "string",
    "iat": 1234567890,
    "exp": 1234567890,
    "jti": "ID.xxxxx",
    "amr": ["pwd"],
    "idp": "string",
    "nonce": "string",
    "auth_time": 1234567890,
    "at_hash": "string"
}

Have a small PR to fix this in case the provider does indeed return a non string value for the name field. If anyone can review who has this issue.

https://github.com/open-webui/open-webui/pull/8493

<!-- gh-comment-id:2585699136 --> @kyunwang commented on GitHub (Jan 12, 2025): Been trying to reproduce this issue but unable to do so. Having looked into to the code, the default value `User` should have taken over if the name property was not in the response. Or in the off chance that the provider returned the `name` field as a different type, such as a number. Tested with few scenarios and the default value is taken over as expected. Below is the example user info returned by the provider which does not contain any name or related information. And uses the fallback as expected. <details> <summary>Example user info returned by provider</summary> ```json { "sub": "string", "email": "my-email@example.com", "ver": 1, "iss": "https://<provider>/oauth2/default", "aud": "string", "iat": 1234567890, "exp": 1234567890, "jti": "ID.xxxxx", "amr": ["pwd"], "idp": "string", "nonce": "string", "auth_time": 1234567890, "at_hash": "string" } ``` </details> Have a small PR to fix this in case the provider does indeed return a non string value for the `name` field. If anyone can review who has this issue. https://github.com/open-webui/open-webui/pull/8493
Author
Owner

@annatech commented on GitHub (Jan 22, 2025):

Confirmed that open-webui v0.5.5 does not fix this issue. I guess the PR wasn't merged yet? I meant to test it but because I deploy to kubernetes, I'd have to build and deploy my own image with the changes included. Doable. Just haven't gotten around to it yet.

Anyone else out there available to test?

UPDATE

  • I spoke to soon. I just updated my deployment to open-webui:0.5.5 (and ollama:0.5.7) and oidc works perfectly.
<!-- gh-comment-id:2608263773 --> @annatech commented on GitHub (Jan 22, 2025): Confirmed that open-webui v0.5.5 does not fix this issue. I guess the PR wasn't merged yet? I meant to test it but because I deploy to kubernetes, I'd have to build and deploy my own image with the changes included. Doable. Just haven't gotten around to it yet. Anyone else out there available to test? UPDATE - I spoke to soon. I just updated my deployment to open-webui:0.5.5 (and ollama:0.5.7) and oidc works perfectly.
Author
Owner

@karllee830 commented on GitHub (Jan 24, 2025):

Confirmed that open-webui v0.5.5 does not fix this issue. I guess the PR wasn't merged yet? I meant to test it but because I deploy to kubernetes, I'd have to build and deploy my own image with the changes included. Doable. Just haven't gotten around to it yet.

Anyone else out there available to test?

UPDATE

  • I spoke to soon. I just updated my deployment to open-webui:0.5.5 (and ollama:0.5.7) and oidc works perfectly.

Based on my testing, version 0.5.7 still has this issue. It is expected to wait for https://github.com/open-webui/open-webui/pull/8493 to be approved.

<!-- gh-comment-id:2611865942 --> @karllee830 commented on GitHub (Jan 24, 2025): > Confirmed that open-webui v0.5.5 does not fix this issue. I guess the PR wasn't merged yet? I meant to test it but because I deploy to kubernetes, I'd have to build and deploy my own image with the changes included. Doable. Just haven't gotten around to it yet. > > Anyone else out there available to test? > > UPDATE > > * I spoke to soon. I just updated my deployment to open-webui:0.5.5 (and ollama:0.5.7) and oidc works perfectly. Based on my testing, version 0.5.7 still has this issue. It is expected to wait for https://github.com/open-webui/open-webui/pull/8493 to be approved.
Author
Owner

@tjbck commented on GitHub (Jan 30, 2025):

Should be fixed on dev, testing wanted here!

<!-- gh-comment-id:2623583151 --> @tjbck commented on GitHub (Jan 30, 2025): Should be fixed on dev, testing wanted here!
Author
Owner

@karllee830 commented on GitHub (Jan 31, 2025):

Should be fixed on dev, testing wanted here!

Confirmed after my testing that this has been fixed. :)

<!-- gh-comment-id:2626630940 --> @karllee830 commented on GitHub (Jan 31, 2025): > Should be fixed on dev, testing wanted here! Confirmed after my testing that this has been fixed. :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#134808