mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #23537] [CLOSED] feat: add support for custom SSO/OAuth providers #66100
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23537
Author: @RoryChou-flux
Created: 4/9/2026
Status: ❌ Closed
Base:
dev← Head:feat/custom-sso-providers📝 Commits (1)
f49104ffeat: add support for custom SSO/OAuth providers📊 Changes
8 files changed (+867 additions, -134 deletions)
View changed files
📝
backend/open_webui/config.py(+134 -1)📝
backend/open_webui/main.py(+14 -1)📝
backend/open_webui/routers/auths.py(+133 -0)📝
backend/open_webui/utils/oauth.py(+41 -18)📝
src/lib/apis/auths/index.ts(+100 -0)📝
src/lib/components/admin/Settings.svelte(+4 -1)📝
src/lib/components/admin/Settings/General.svelte(+364 -2)📝
src/routes/auth/+page.svelte(+77 -111)📄 Description
Pull Request Checklist
Discussion: https://github.com/open-webui/open-webui/discussions/23536
devdev.feat:Changelog Entry
Description
Allow administrators to configure multiple custom OAuth/SSO providers at runtime via Admin UI or
CUSTOM_OAUTH_PROVIDERS_CONFIGenvironment variable. This enables use cases like multiple Feishu enterprises, multiple OIDC providers, or any OAuth2-compatible provider — without code changes.Related PRs #12945 and #18948 focus on Admin UI for existing single-instance OAuth config. This PR specifically addresses the multiple providers of the same type use case.
Added
CUSTOM_OAUTH_PROVIDERS_CONFIGPersistentConfig for dynamic custom OAuth provider storage (supports both env var JSON array and Admin UI)/api/v1/auths/admin/config/oauth/customsub_claim,email_claim,username_claim,picture_claim,email_fallbackprovider_typefield on all providers to generalize type-specific logicreload_providers()on OAuthManager for hot-reloading after config changes{#each}loopChanged
/api/configoauth.providersvalues from plain strings to objects{name, icon_url, is_custom, provider_type}provider_typeinstead of hardcoded provider namenameandprovider_typefieldsFixed
sub_claimfromuser_idtoopen_idto match actual Feishu v1 userinfo API responseSecurity
githubprovider onlyBreaking Changes
/api/configoauth.providersresponse format changed from{key: name_string}to{key: {name, icon_url, is_custom, provider_type}}. Only affects the bundled frontend (updated in this PR).Configuration Example
No database migration needed.
Testing Performed
FEISHU_CLIENT_ID+CUSTOM_OAUTH_PROVIDERS_CONFIG(two Feishu providers)/api/configreturns both providers in new object formatContributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.