Skip to content

Commit 873c7ae

Browse files
committed
Adding missing scope/client
Signed-off-by: Matthias Wessendorf <[email protected]>
1 parent 70ff12e commit 873c7ae

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

build/keycloak.mk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,20 @@ keycloak-setup-realm: ## Setup OpenShift realm with token exchange support
216216
exit 1; \
217217
fi; \
218218
echo ""; \
219+
echo "Creating mcp-client public client..."; \
220+
MCP_PUBLIC_CLIENT_RESPONSE=$$(curl -s -w "HTTPCODE:%{http_code}" -X POST "http://localhost:8090/admin/realms/openshift/clients" \
221+
-H "Authorization: Bearer $$TOKEN" \
222+
-H "Content-Type: application/json" \
223+
-d '{"clientId":"mcp-client","enabled":true,"publicClient":true,"standardFlowEnabled":true,"directAccessGrantsEnabled":true,"serviceAccountsEnabled":false,"authorizationServicesEnabled":false,"redirectUris":["*"],"defaultClientScopes":[],"optionalClientScopes":["mcp-server"]}'); \
224+
MCP_PUBLIC_CLIENT_CODE=$$(echo "$$MCP_PUBLIC_CLIENT_RESPONSE" | grep -o "HTTPCODE:[0-9]*" | cut -d: -f2); \
225+
if [ "$$MCP_PUBLIC_CLIENT_CODE" = "201" ] || [ "$$MCP_PUBLIC_CLIENT_CODE" = "409" ]; then \
226+
if [ "$$MCP_PUBLIC_CLIENT_CODE" = "201" ]; then echo "✅ mcp-client public client created"; \
227+
else echo "✅ mcp-client public client already exists"; fi; \
228+
else \
229+
echo "❌ Failed to create mcp-client public client (HTTP $$MCP_PUBLIC_CLIENT_CODE)"; \
230+
exit 1; \
231+
fi; \
232+
echo ""; \
219233
echo "Creating mcp-server client with token exchange..."; \
220234
MCP_CLIENT_RESPONSE=$$(curl -s -w "HTTPCODE:%{http_code}" -X POST "http://localhost:8090/admin/realms/openshift/clients" \
221235
-H "Authorization: Bearer $$TOKEN" \
@@ -289,6 +303,9 @@ keycloak-setup-realm: ## Setup OpenShift realm with token exchange support
289303
echo " Email: [email protected]"; \
290304
echo ""; \
291305
echo "Clients:"; \
306+
echo " mcp-client (public, for browser-based auth)"; \
307+
echo " Client ID: mcp-client"; \
308+
echo " Optional Scopes: mcp-server"; \
292309
echo " mcp-server (confidential, token exchange enabled)"; \
293310
echo " Client ID: mcp-server"; \
294311
echo " Client Secret: $$CLIENT_SECRET"; \

0 commit comments

Comments
 (0)