Pcornel
Identity · Single Sign-On & Federation

Keycloak

Cheat sheet · https://pcornel.dk/topic.php?topic=6259

Back to the Topic

Answer

Keycloak is an open-source identity and access management server. It authenticates users and issues tokens over OpenID Connect, OAuth 2.0 and SAML 2.0, with realms, clients, roles, configurable authentication flows, identity brokering and LDAP/AD user federation.

Remember

The master realm is for administering Keycloak — put applications and users in their own realm. A client is an application; client scopes decide which claims go into tokens. Every realm publishes its OIDC metadata at /realms/<realm>/.well-known/openid-configuration.

First checks

  • curl -s https://<host>/realms/<realm>/.well-known/openid-configuration — issuer and endpoints.
  • kcadm.sh get clients -r <realm> --fields clientId,enabled,protocol — which clients exist.
  • Admin console → Realm → Events — login errors with reason (e.g. invalid_user_credentials).
  • Admin console → User federation → Test connection / Test authentication.

Verify in this order

application → Keycloak realm (authorization endpoint) → authentication flow (local, LDAP federation or brokered IdP) → session → client scopes and mappers → token → application validates issuer, audience and signature

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6259

Confirmation

Confirm action

Continue?