mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-24 22:37:38 -05:00
fix: startup logs an invalid OAuth client error for MCP servers that were never registered (#34938)
An OAuth 2.1 MCP tool server that had not gone through Register Client yet logged "Stored OAuth client data is invalid; reconnect this tool server" on every startup, even though nothing was stored. Such a server is now skipped at startup, the same way it is skipped when a user connects, so the log stays quiet until it is registered. Client data that cannot be read, for example after the encryption key changed, is still reported. Relates to #34937
This commit is contained in:
1 parent
3e88289868
commit
810f2ddd8a
1 file changed
+2
-1
@@ -653,8 +653,9 @@ async def initialize_runtime_config(app: FastAPI):
|
||||
if tool_server_connection.get('type', 'openapi') == 'mcp':
|
||||
server_id = (tool_server_connection.get('info') or {}).get('id')
|
||||
auth_type = tool_server_connection.get('auth_type', 'none')
|
||||
oauth_client_info = (tool_server_connection.get('info') or {}).get('oauth_client_info', '')
|
||||
|
||||
if server_id and auth_type in ('oauth_2.1', 'oauth_2.1_static'):
|
||||
if server_id and auth_type in ('oauth_2.1', 'oauth_2.1_static') and oauth_client_info:
|
||||
try:
|
||||
oauth_client_info = resolve_oauth_client_info(tool_server_connection)
|
||||
oauth_client_info = await recover_oauth_client_metadata(tool_server_connection, oauth_client_info)
|
||||
|
||||
Reference in new issue
Block a user