Implement Keycloak fine-grained authorization with UMA 2.0 and policy evaluation API

domain: keycloak.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Enable Authorization Services on the Keycloak client; create resource types, resource instances, and scopes in the Authorization tab of the client configuration
  2. Define policies (role-based, attribute-based, JavaScript, or composite) and create permissions linking resources/scopes to policies in the Keycloak Authorization Services UI or via the Protection API
  3. From the resource server, use the Keycloak Policy Enforcer (keycloak-policy-enforcer adapter or equivalent) to intercept requests and call the token introspection/RPT endpoint
  4. To evaluate permissions programmatically, POST to /realms/{realm}/protocol/openid-connect/token with grant_type urn:ietf:params:oauth:grant-type:uma-ticket, audience (client_id), and the permission claim ({resource}#{scope})
  5. The AS returns an RPT (Requesting Party Token) — a JWT containing the permissions grant; verify the RPT locally by checking its permissions array for the requested resource and scope
  6. Use the Policy Evaluation UI (Realm > Clients > Authorization > Evaluate) for debugging; it shows which policies matched, which permissions were granted, and the evaluation decision

Known gotchas

Related routes

Configure Auth0 Fine-Grained Authorization (FGA) with a Zanzibar-style relationship model for multi-tenant resource access
docs.fga.dev · 6 steps · unrated
Automate Keycloak realm and client configuration via the Admin REST API
keycloak.org · 6 steps · unrated
Implement the OAuth device authorization grant (RFC 8628)
identity-general · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans