diff --git a/app-hooks/post-installation/15-setup-keycloak-provider.sh b/app-hooks/post-installation/15-setup-keycloak-provider.sh index e8341e2..061cde4 100755 --- a/app-hooks/post-installation/15-setup-keycloak-provider.sh +++ b/app-hooks/post-installation/15-setup-keycloak-provider.sh @@ -13,6 +13,14 @@ echo "====================================================================" echo "Configuring user_oidc provider for Keycloak..." echo "====================================================================" +# Quick check: Is keycloak service in the Docker network? +# When the keycloak profile is not active, this hostname won't resolve. +if ! getent hosts keycloak >/dev/null 2>&1; then + echo " Keycloak service not detected in Docker network (profile not active)" + echo " Skipping keycloak provider configuration" + exit 0 +fi + # Wait for Keycloak to be ready and realm to be available echo "Waiting for Keycloak realm to be available..." MAX_RETRIES=30 diff --git a/tests/server/oauth/test_scope_authorization.py b/tests/server/oauth/test_scope_authorization.py index 82acfaa..adccc70 100644 --- a/tests/server/oauth/test_scope_authorization.py +++ b/tests/server/oauth/test_scope_authorization.py @@ -33,7 +33,7 @@ async def test_prm_endpoint(): assert prm_data["resource"] == "http://localhost:8001/mcp" assert "notes:read" in prm_data["scopes_supported"] assert "notes:write" in prm_data["scopes_supported"] - assert "http://localhost:8080" in prm_data["authorization_servers"] + assert "http://localhost:8001" in prm_data["authorization_servers"] assert "header" in prm_data["bearer_methods_supported"] assert "RS256" in prm_data["resource_signing_alg_values_supported"]