From f16f852b239a083c6ec68ebfd3cf8073d54ba08b Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Thu, 15 Jan 2026 16:13:50 +0100 Subject: [PATCH] fix(api): return OIDC config in hybrid mode for Astrolabe OAuth flow The /api/v1/status endpoint now returns OIDC configuration (discovery_url, issuer) when running in hybrid mode (multi_user_basic + offline_access), not just in pure OAuth mode. This allows Astrolabe to discover the IdP and complete the OAuth flow for obtaining tokens to call MCP server management APIs. Co-Authored-By: Claude Opus 4.5 --- nextcloud_mcp_server/api/management.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nextcloud_mcp_server/api/management.py b/nextcloud_mcp_server/api/management.py index 4922939..bfded9e 100644 --- a/nextcloud_mcp_server/api/management.py +++ b/nextcloud_mcp_server/api/management.py @@ -387,8 +387,13 @@ async def get_server_status(request: Request) -> JSONResponse: if mode == AuthMode.MULTI_USER_BASIC: response_data["supports_app_passwords"] = settings.enable_offline_access - # Include OIDC configuration if in OAuth mode - if auth_mode == "oauth": + # Include OIDC configuration if OAuth is available + # This includes OAuth mode AND hybrid mode (multi_user_basic + offline_access) + # Astrolabe needs OIDC config to discover IdP for OAuth flow in hybrid mode + oauth_provisioning_available = auth_mode == "oauth" or ( + mode == AuthMode.MULTI_USER_BASIC and settings.enable_offline_access + ) + if oauth_provisioning_available: # Provide IdP discovery information for NC PHP app oidc_config = {}