A realm for your staff
Keep staff in their own realm, apart from any customer realm. Their password policy, two-factor rules and session lengths can then be stricter than a public login’s, without touching your customers.
People reach the realm in one of two ways. Most teams with a directory use user federation. Teams whose staff already live in Microsoft Entra ID or Google Workspace broker that identity provider instead, and use the realm as the hub that every tool trusts.
Users and groups from LDAP or Active Directory
Under User federation, add an LDAP provider and pick Active Directory or your LDAP server as the vendor. Keycloak needs:
- A connection URL, ideally
ldaps://on port 636. - A bind DN and password for a read-only service account.
- The users DN, and a filter if only some people may sign in. The LDAP filter tool builds one.
- An edit mode: read only, writable (changes go back to the directory) or unsynced.
Passwords stay in the directory: Keycloak checks them there at each sign-in. A group mapper brings directory groups into the realm, and periodic sync keeps users current.
Your directory must accept connections from your cluster’s region. We do not offer a VPN or private link today, so it needs an address reachable over the internet, with LDAPS and access limited to what you allow. Outbound traffic from your Keycloak is closed by default; we open it to your directory host.
Connecting each tool
Each tool is a client in the staff realm. For OpenID Connect, use a confidential client with the tool’s callback as the only valid redirect URI.
| Tool | Protocol | Where it is set |
|---|---|---|
| Grafana | OpenID Connect | The generic OAuth section; role_attribute_path maps groups to Grafana roles |
| GitLab | OpenID Connect or SAML | The openid_connect or saml OmniAuth provider |
| Argo CD | OpenID Connect | oidc.config in argocd-cm, groups in argocd-rbac-cm |
| Vault | OpenID Connect | The OIDC auth method, with a role that sets groups_claim |
Every tool reads the realm’s discovery document at https://auth.yourcompany.com/realms/staff/.well-known/openid-configuration. For SAML-only tools, the SAML client generator writes the client for you.
Groups in every token
Create a client scope with a Group Membership mapper, claim name groups, full group path off, and add it to each tool’s client. The tokens then carry:
"groups": ["platform", "sre", "readonly"]Each tool maps those names to its own roles: a Grafana admin, an Argo CD project role, a Vault policy. Removing someone from a group in the directory removes their access everywhere at the next sign-in.
Two-factor sign-in and sessions
Make an authenticator app, a security key or a passkey required for staff, and keep sessions as long as a working day. One sign-in then covers every tool until the session ends, and signing out of the realm ends it everywhere that supports logout. Passkeys and MFA has the details.