Keycloak Scim Client

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a keycloak scim client by adding a provisioning plugin and mapping user fields. This setup pushes user accounts and group roles from your realm to outside tools. Most teams start by linking their main directory to downstream databases and cloud apps. When teams grant broad group roles during this sync, users get too much standing power. A single synced group can give an engineer full write rights across production systems. How a keycloak scim client works in practice Keycloak does

Keycloak + Client-Initiated Backchannel Authentication (CIBA): the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up a keycloak scim client by adding a provisioning plugin and mapping user fields. This setup pushes user accounts and group roles from your realm to outside tools. Most teams start by linking their main directory to downstream databases and cloud apps. When teams grant broad group roles during this sync, users get too much standing power. A single synced group can give an engineer full write rights across production systems.

How a keycloak scim client works in practice

Keycloak does not include a built-in SCIM server or client out of the box. Platform teams add an open-source extension or custom provider to handle the protocol. Once you add the extension, the identity server listens for user and group changes. When an admin creates a user, the server sends a web request to the target app. The target app reads this payload and builds a matching local user account.

Group mapping drives how permissions work after the account sync finishes. You map a central realm group to a matching role in the destination tool. When a worker joins the realm group, the client updates their outside role right away. When HR removes that worker from the realm, the client turns off the outside account. This flow stops orphaned accounts from sitting open after people leave the company.

Why directory sync is only half of the control loop

A SCIM setup solves account creation and removal across your stack. It keeps user lists clean and matches roles to your central directory. It also cuts out manual ticket work for your IT and security teams. Reviewers can check one central realm to see who holds an active account.

Still, directory sync only controls who holds an account in a target system. It does not check or limit what that person does after they log in. Once a synced role grants database access, the user can run any query that role allows. SCIM cannot pause a dangerous delete command or ask a peer for approval first. It also cannot rewrite sensitive fields like emails, phone numbers, or card numbers in query results.

Keycloak + Client-Initiated Backchannel Authentication (CIBA): architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Managing group roles and sync errors

Sync jobs fail when network links drop or target APIs change their rules. If a deactivation request fails, a former worker might keep an active account in a tool. Teams must check sync logs often and set up alerts for failed web requests. You also need clear rules for how group names map to local tool permissions.

Many teams fall into the trap of making a few broad groups for ease of use. They give a whole engineering group admin rights so nobody gets blocked during an outage. This habit turns a clean identity sync into a major risk for production data. Even with small groups, static roles stay active twenty-four hours a day. True safety requires controls that check every command and query at the moment it runs.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Does Keycloak support SCIM out of the box?

No, the core platform does not ship with native SCIM client or server support. You must install a community plugin or run an external sync tool to add this feature.

What happens when a SCIM sync request fails?

When a sync call fails, the target app keeps its old user and group state. Teams must check error logs and run a manual or scheduled retry to fix the drift.

Can SCIM restrict which SQL queries an engineer runs?

No, SCIM only creates accounts and assigns high-level group roles in the target app. It cannot read, approve, or mask individual queries and commands during a live session.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.