[GH-ISSUE #14601] feat: Admin creation from password hash #17313

Closed
opened 2026-04-19 23:02:54 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @ArtemijRodionov on GitHub (Jun 2, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14601

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

  • I'd like to use password authentication
  • I can't expose an endpoint without authentication or endpoint that will signup the first one who submitted a signup form
  • I can't store a raw password in my system, so I can't call /api/v1/auths/signup

Desired Solution you'd like

I want to be able to create an admin user using password hash. It would be nice to have CLI for that or at least config variable

Alternatives Considered

No response

Additional Context

No response

Originally created by @ArtemijRodionov on GitHub (Jun 2, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/14601 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description * I'd like to use password authentication * I can't expose an endpoint without authentication or endpoint that will signup the first one who submitted a signup form * I can't store a raw password in my system, so I can't call `/api/v1/auths/signup` ### Desired Solution you'd like I want to be able to create an admin user using password hash. It would be nice to have CLI for that or at least config variable ### Alternatives Considered _No response_ ### Additional Context _No response_
Author
Owner

@tjbck commented on GitHub (Jun 2, 2025):

Passwords are automatically hashed.

<!-- gh-comment-id:2931501722 --> @tjbck commented on GitHub (Jun 2, 2025): Passwords are automatically hashed.
Author
Owner

@ArtemijRodionov commented on GitHub (Jun 2, 2025):

Are there any solution for such scenario?

Will it be good enough If I create a cli that call something like that?

hashed = args.hashed
if not args.hashed:
    hashed = get_password_hash(form_data.password)
role = (
    "admin" if Users.get_num_users() == 0 else config.DEFAULT_USER_ROLE
)
Auths.insert_new_auth(
            args.email,
            hashed,
            args.name,
            args.profile_image_url,
            role,
)

53764fe648/backend/open_webui/routers/auths.py (L502)

<!-- gh-comment-id:2931503272 --> @ArtemijRodionov commented on GitHub (Jun 2, 2025): Are there any solution for such scenario? Will it be good enough If I create a cli that call something like that? ``` hashed = args.hashed if not args.hashed: hashed = get_password_hash(form_data.password) role = ( "admin" if Users.get_num_users() == 0 else config.DEFAULT_USER_ROLE ) Auths.insert_new_auth( args.email, hashed, args.name, args.profile_image_url, role, ) ``` https://github.com/open-webui/open-webui/blob/53764fe64884da147359e54ed6d9607fe57f1600/backend/open_webui/routers/auths.py#L502
Author
Owner

@ArtemijRodionov commented on GitHub (Jun 2, 2025):

Hello @tjbck, at the moment, the backend expects a raw (plain-text) password, but I only have a bcrypt password hash available

<!-- gh-comment-id:2931536116 --> @ArtemijRodionov commented on GitHub (Jun 2, 2025): Hello @tjbck, at the moment, the backend expects a raw (plain-text) password, but I only have a bcrypt password hash available
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#17313