mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[PR #8638] [MERGED] refactor: Extend OIDC support to all OAuth authentication methods #37892
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/8638
Author: @Tryanks
Created: 1/17/2025
Status: ✅ Merged
Merged: 1/17/2025
Merged by: @tjbck
Base:
dev← Head:oauth2-github📝 Commits (2)
f3e6dacrefac: Extend OIDC support to all OAuth authentication methodse7971b5enh: add github oauth2 provider support📊 Changes
3 files changed (+100 additions, -24 deletions)
View changed files
📝
backend/open_webui/config.py(+81 -12)📝
backend/open_webui/utils/oauth.py(+3 -12)📝
src/routes/auth/+page.svelte(+16 -0)📄 Description
Related Issue: #8614; Related PR: #8624
I sincerely apologize for opening two PRs for the same feature request. After thorough consideration, I believe it is more reasonable to reimplement the significant changes from a single commit into two separate changes.
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
In the current OIDC implementation,
OAUTH_PROVIDERSis hardcoded to only support the fixed OIDC format using the.well-knownprotocol. This means it cannot provide an integration method for authenticators like Github, which only offer OAuth 2.0.This PR changes the way
authlib.OAuth()registers providers by delegating the more flexible.register()behavior to the configuration initialization process. This enables support for all authenticator protocols that authlib can handle and further enhances extensibility.Additionally, in the subsequent commit, the Github OAuth Provider has also been implemented.
Added Env vars:
GITHUB_CLIENT_ID- Github OAuth App Client IDGITHUB_CLIENT_SECRET- Github OAuth App Client SecretGITHUB_OAUTH_SCOPE- Github OAuth App Scope, default "user:email"GITHUB_CLIENT_REDIRECT_URI- The recall url for Authentication.Changed
Added
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.