auths
Classes
AuthsClient
AuthsClient(client: OWUIClientBase)
Bases: ResourceBase
Client for the Auths endpoints.
This client handles authentication operations such as signin, signup, password updates, and administrative configurations.
- Code Reference client Classes OpenWebUI Attributes auths
Source code in src/owui_client/client_base.py
Functions
get_session_user
get_session_user() -> SessionUserInfoResponse
Get the current session user information.
This endpoint retrieves detailed information about the currently authenticated user, including their profile, permissions, and status.
Returns:
| Type | Description |
|---|---|
SessionUserInfoResponse
|
|
Source code in src/owui_client/routers/auths.py
update_profile
update_profile(form_data: UpdateProfileForm) -> UserProfileImageResponse
Update the current user's profile.
Updates the user's name, bio, gender, date of birth, and profile image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
UpdateProfileForm
|
The profile update information |
required |
Returns:
| Type | Description |
|---|---|
UserProfileImageResponse
|
|
Source code in src/owui_client/routers/auths.py
update_timezone
update_timezone(form_data: UpdateTimezoneForm) -> bool
Update the current user's timezone.
Updates the user's timezone preference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
UpdateTimezoneForm
|
The timezone update information |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if successful |
Source code in src/owui_client/routers/auths.py
update_password
update_password(form_data: UpdatePasswordForm) -> bool
Update the current user's password.
Verifies the current password before updating to the new one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
UpdatePasswordForm
|
The password update information (current and new password) |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if successful |
Source code in src/owui_client/routers/auths.py
signin
signin(form_data: SigninForm, set_client_api_key: bool = True) -> SessionUserResponse
Sign in with email and password.
Authenticates the user using email and password. On success, it returns a session token and user details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
SigninForm
|
The signin credentials (email, password) |
required |
set_client_api_key
|
bool
|
If True (default), updates the main client's API key upon success |
True
|
Returns:
| Type | Description |
|---|---|
SessionUserResponse
|
|
Source code in src/owui_client/routers/auths.py
signin_ldap
signin_ldap(form_data: LdapForm, set_client_api_key: bool = True) -> SessionUserResponse
Sign in with LDAP credentials.
Authenticates the user using LDAP. Requires LDAP to be enabled and configured on the server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
LdapForm
|
The LDAP credentials (user, password) |
required |
set_client_api_key
|
bool
|
If True (default), updates the main client's API key upon success |
True
|
Returns:
| Type | Description |
|---|---|
SessionUserResponse
|
|
Source code in src/owui_client/routers/auths.py
signup
signup(form_data: SignupForm, set_client_api_key: bool = True) -> SessionUserResponse
Sign up a new user.
Creates a new user account. If this is the first user, they will be assigned the 'admin' role. Subsequent users are assigned the default role (usually 'pending').
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
SignupForm
|
The signup information (name, email, password, etc.) |
required |
set_client_api_key
|
bool
|
If True (default), updates the main client's API key upon success |
True
|
Returns:
| Type | Description |
|---|---|
SessionUserResponse
|
|
Source code in src/owui_client/routers/auths.py
add_user
add_user(form_data: AddUserForm) -> SigninResponse
Add a new user (Admin only).
Allows an admin to create a new user account directly, specifying their role.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
AddUserForm
|
The user information (name, email, password, role, etc.) |
required |
Returns:
| Type | Description |
|---|---|
SigninResponse
|
|
Source code in src/owui_client/routers/auths.py
get_admin_details
get_admin_details() -> AdminDetails
Get admin details.
Retrieves the name and email of the admin user, if configured to be shown.
Returns:
| Type | Description |
|---|---|
AdminDetails
|
|
Source code in src/owui_client/routers/auths.py
sign_out
sign_out(unset_client_api_key: bool = True) -> SignoutResponse
Sign out the current user.
Invalidates the current session token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unset_client_api_key
|
bool
|
If True (default), clears the main client's API key upon success |
True
|
Returns:
| Type | Description |
|---|---|
SignoutResponse
|
|
Source code in src/owui_client/routers/auths.py
get_admin_config
get_admin_config() -> AdminConfig
Get the admin configuration.
Retrieves global configuration settings for the application.
Returns:
| Type | Description |
|---|---|
AdminConfig
|
|
Source code in src/owui_client/routers/auths.py
update_admin_config
update_admin_config(config: AdminConfig) -> AdminConfig
Update the admin configuration.
Updates global configuration settings. Requires admin privileges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
AdminConfig
|
The new configuration |
required |
Returns:
| Type | Description |
|---|---|
AdminConfig
|
|
Source code in src/owui_client/routers/auths.py
get_ldap_server
get_ldap_server() -> LdapServerConfig
Get the LDAP server configuration.
Retrieves the LDAP connection settings. Requires admin privileges.
Returns:
| Type | Description |
|---|---|
LdapServerConfig
|
|
Source code in src/owui_client/routers/auths.py
update_ldap_server
update_ldap_server(form_data: LdapServerConfig) -> LdapServerConfig
Update the LDAP server configuration.
Updates the LDAP connection settings. Requires admin privileges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
LdapServerConfig
|
The LDAP server configuration |
required |
Returns:
| Type | Description |
|---|---|
LdapServerConfig
|
|
Source code in src/owui_client/routers/auths.py
get_ldap_config
get_ldap_config() -> LdapConfigResponse
Get the LDAP configuration status.
Checks if LDAP authentication is enabled.
Returns:
| Type | Description |
|---|---|
LdapConfigResponse
|
|
Source code in src/owui_client/routers/auths.py
update_ldap_config
update_ldap_config(form_data: LdapConfigForm) -> LdapConfigResponse
Update the LDAP configuration status.
Enables or disables LDAP authentication. Requires admin privileges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
LdapConfigForm
|
The LDAP configuration form |
required |
Returns:
| Type | Description |
|---|---|
LdapConfigResponse
|
|
Source code in src/owui_client/routers/auths.py
generate_api_key
generate_api_key() -> ApiKey
Generate a new API key for the current user.
Creates or rotates the API key for the current user.
Returns:
| Type | Description |
|---|---|
ApiKey
|
|
Source code in src/owui_client/routers/auths.py
delete_api_key
Delete the current user's API key.
Removes the API key associated with the current user.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if successful |
Source code in src/owui_client/routers/auths.py
get_api_key
get_api_key() -> ApiKey
Get the current user's API key.
Retrieves the existing API key for the current user.
Returns:
| Type | Description |
|---|---|
ApiKey
|
|
Source code in src/owui_client/routers/auths.py
token_exchange
token_exchange(provider: str, form_data: TokenExchangeForm, set_client_api_key: bool = True) -> SessionUserResponse
Exchange an external OAuth provider token for an Open WebUI JWT.
This endpoint allows exchanging an OAuth access token from an external provider (e.g., Google, GitHub, Microsoft) for an Open WebUI session token. The feature must be enabled on the server with ENABLE_OAUTH_TOKEN_EXCHANGE=True.
The user must already exist in Open WebUI (created via web interface signin) for the token exchange to succeed. The provider must be configured in the server's OAUTH_PROVIDERS setting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
provider
|
str
|
The OAuth provider name (e.g., "google", "github", "microsoft") |
required |
form_data
|
TokenExchangeForm
|
The token exchange form containing the OAuth access token |
required |
set_client_api_key
|
bool
|
If True (default), updates the main client's API key upon success |
True
|
Returns:
| Type | Description |
|---|---|
SessionUserResponse
|
|
Raises:
| Type | Description |
|---|---|
HTTPError
|
403 if token exchange is disabled on the server |
HTTPError
|
404 if the provider is not configured |
HTTPError
|
400 if the token is invalid or user info cannot be fetched |
HTTPError
|
403 if the user is not found (must sign in via web first) |