mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #14786] [CLOSED] feat: Add OAuth support for Tool Server authentication #23593
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/14786
Author: @jescalada
Created: 6/8/2025
Status: ❌ Closed
Base:
dev← Head:add-tool-server-oauth📝 Commits (10+)
0f111f2enh: add TOOL_GOOGLE configs9ac03f0enh: add TOOL_ATLASSIAN configs3758d87enh: add TOOL_SERVER_OAUTH_PROVIDERS loaderf35d5f3fix: extract tool server config scopes4fa41befeat: add ToolServerOAuthManager class and init62e554dfeat: add tool server login and callback support for OAuth0264866enh: import ToolServerOAuthManager to main.py263a33ffeat: add login endpoint for any OAuth provider909ca31feat: add OAuth callback endpoint226d82ffeat: add endpoint and middleware for fetching providers📊 Changes
10 files changed (+371 additions, -20 deletions)
View changed files
📝
backend/open_webui/config.py(+129 -0)📝
backend/open_webui/main.py(+56 -2)📝
backend/open_webui/routers/configs.py(+1 -1)📝
backend/open_webui/utils/oauth.py(+42 -0)📝
backend/open_webui/utils/tools.py(+2 -2)📝
src/lib/apis/configs/index.ts(+1 -1)📝
src/lib/apis/index.ts(+9 -2)📝
src/lib/components/AddServerModal.svelte(+115 -11)📝
src/lib/components/chat/Settings/Tools/Connection.svelte(+14 -0)📝
src/routes/+layout.svelte(+2 -1)📄 Description
This PR adds OAuth support for Tool Server authentication.
Note: This PR enables logging in through a provider configured in the backend, and getting an "access token" which can be used to validate subsequent requests. Available providers are Google and Atlassian. Feel free to extend this for the providers that are most relevant!
This PR does not implement the entire OpenWebUI -> OAuth + MCP flow discussed in #14121. I hit a few roadblocks along the way and I believe some extra refactoring work is needed to get it to work. I'll write some suggestions about how we could approach that and some clues I found.
Changelog Entry
Description
Added
AddServerModalto show providers and handle entire OAuth flow, including manual token refreshAdditional Information
Screenshots or Videos
Demo Video
Demo
Note that my cursor isn't showing in the video, sorry about that!
Testing
If you'd like to test this PR, you can create your own Google auth client here: https://console.cloud.google.com/apis/credentials
Otherwise, you can do the same with an Atlassian OAuth 2.0 app: https://developer.atlassian.com/console/myapps
Otherwise, I can post my credentials and then manually add a reviewer's email (otherwise it won't work, since it's a test auth app).
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.