Skip to content

Commit 0a2325e

Browse files
committed
enable event logging
Signed-off-by: Matthias Wessendorf <[email protected]>
1 parent 873c7ae commit 0a2325e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

build/keycloak.mk

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,18 @@ keycloak-setup-realm: ## Setup OpenShift realm with token exchange support
9494
exit 1; \
9595
fi; \
9696
echo ""; \
97+
echo "Configuring realm events..."; \
98+
EVENT_CONFIG_RESPONSE=$$(curl -s -w "HTTPCODE:%{http_code}" -X PUT "http://localhost:8090/admin/realms/openshift" \
99+
-H "Authorization: Bearer $$TOKEN" \
100+
-H "Content-Type: application/json" \
101+
-d '{"realm":"openshift","enabled":true,"eventsEnabled":true,"eventsListeners":["jboss-logging"],"adminEventsEnabled":true,"adminEventsDetailsEnabled":true}'); \
102+
EVENT_CONFIG_CODE=$$(echo "$$EVENT_CONFIG_RESPONSE" | grep -o "HTTPCODE:[0-9]*" | cut -d: -f2); \
103+
if [ "$$EVENT_CONFIG_CODE" = "204" ]; then \
104+
echo "✅ User and admin event logging enabled"; \
105+
else \
106+
echo "⚠️ Could not configure event logging (HTTP $$EVENT_CONFIG_CODE)"; \
107+
fi; \
108+
echo ""; \
97109
echo "Creating mcp:openshift client scope..."; \
98110
SCOPE_RESPONSE=$$(curl -s -w "HTTPCODE:%{http_code}" -X POST "http://localhost:8090/admin/realms/openshift/client-scopes" \
99111
-H "Authorization: Bearer $$TOKEN" \

0 commit comments

Comments
 (0)