[GH-ISSUE #3496] First OIDC account is not admin #28816

Closed
opened 2026-04-25 03:21:46 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @Semihal on GitHub (Jun 28, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/3496

Bug Report

Description

Bug Summary:
I create first account (in the whole system) with OIDC and found that is not admin.

Steps to Reproduce:

  • Connect OIDC through environ vars.

Expected Behavior:

  • First account is admin.

Actual Behavior:

  • First account is user.

Environment

  • Open WebUI Version: 0.3.6
Originally created by @Semihal on GitHub (Jun 28, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/3496 # Bug Report ## Description **Bug Summary:** I create first account (in the whole system) with OIDC and found that is not admin. **Steps to Reproduce:** - Connect OIDC through environ vars. **Expected Behavior:** - First account is admin. **Actual Behavior:** - First account is user. ## Environment - **Open WebUI Version:** 0.3.6
Author
Owner

@Semihal commented on GitHub (Jun 28, 2024):

State of SQLite DB before and after create first user.

Before:

>>> from sqlalchemy import create_engine, text

>>> engine = create_engine("sqlite:////<path>/webui.db")
>>> connection = engine.connect()
>>> connection.execute(text("select * from user")).fetchall()
[]

After:

>>> connection.execute(text("select * from user")).fetchall()
[('894d9af6-3108-45fa-a7db-d92b267db0b9', '<first and last name>', '<my email>', 'user', '/user.png', None, xxxxxxx, xxxxx, xxxxxx, 'null', 'null', 'oidc@<my email>')]

First user has user role :(

<!-- gh-comment-id:2196605387 --> @Semihal commented on GitHub (Jun 28, 2024): State of SQLite DB before and after create first user. Before: ```python >>> from sqlalchemy import create_engine, text >>> engine = create_engine("sqlite:////<path>/webui.db") >>> connection = engine.connect() >>> connection.execute(text("select * from user")).fetchall() [] ``` After: ```python >>> connection.execute(text("select * from user")).fetchall() [('894d9af6-3108-45fa-a7db-d92b267db0b9', '<first and last name>', '<my email>', 'user', '/user.png', None, xxxxxxx, xxxxx, xxxxxx, 'null', 'null', 'oidc@<my email>')] ``` First user has user role :(
Author
Owner

@Semihal commented on GitHub (Jun 28, 2024):

79f8620b34/backend/main.py (L2105)

Set DEFAULT_USER_ROLE. This is error?

<!-- gh-comment-id:2196624839 --> @Semihal commented on GitHub (Jun 28, 2024): https://github.com/cheahjs/open-webui-fork/blob/79f8620b34c098c3c42b6c17a8b0f3fb9b5efedf/backend/main.py#L2105 Set DEFAULT_USER_ROLE. This is error?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#28816