mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #23665] Bug: MCP servers with auth_type 'oauth_2.1_static' never receive Bearer token (middleware gap) #35566
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?
Originally created by @dhruvalgupta2003 on GitHub (Apr 13, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23665
Summary
When an MCP tool server is configured with
auth_type: oauth_2.1_static, requests to that server are sent without anAuthorizationheader, so every call fails (401 from the protected resource). This effectively breaks the static-OAuth MCP integration end-to-end — reproducible against Microsoft Entra ID / M365 MCP servers.Introduced alongside
oauth_2.1_staticsupport (commit601bb7835 feat: oauth 2.1 static mcp).Location
backend/open_webui/utils/middleware.pyaround lines 2497–2523.The auth-type dispatch handles
bearer,none,session,system_oauth, andoauth_2.1— but notoauth_2.1_static:Other parts of the codebase already group the two types together — e.g.
main.py:2264,configs.py:181,204,365, andutils/oauth.py:567all usein ('oauth_2.1', 'oauth_2.1_static'). The middleware branch is the outlier.Impact
Suggested fix
@tjbck commented on GitHub (Apr 13, 2026):
Already addressed in dev.