Add Keycloak Openid Connect Provider
To add keycloak openid connect provider support, register a client in your Keycloak realm. Then copy the issuer URL and client keys into your target app. Platform teams use this setup to centralize how engineers log in. It replaces shared local passwords with single sign-on tokens. Still, teams often map broad directory groups straight to high-level admin roles. Once a user logs in, they hold full standing permissions across the system. How to add keycloak openid connect provider step by step
Keycloak + OpenID Connect (OIDC): the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
To add keycloak openid connect provider support, register a client in your Keycloak realm. Then copy the issuer URL and client keys into your target app. Platform teams use this setup to centralize how engineers log in. It replaces shared local passwords with single sign-on tokens. Still, teams often map broad directory groups straight to high-level admin roles. Once a user logs in, they hold full standing permissions across the system.
How to add keycloak openid connect provider step by step
First, choose the right realm inside your Keycloak admin console. A realm groups your users, roles, and client apps together. Create a new client record for the tool you want to protect. Set the client protocol to OpenID Connect so it issues standard identity tokens. Next, define the redirect URLs that your target app uses after login. Keycloak checks these URLs so it only sends tokens to trusted endpoints.
After you save the client record, Keycloak makes a secret key for your app. Copy the client ID, the secret key, and the realm discovery URL. Paste these three values into the login settings of your target service. You also need to set up claim mappers inside your Keycloak realm. Claim mappers read a user's group list and put those groups inside the token. When an engineer logs in, the target app reads those token claims. The app then assigns a local role based on the group list.
Why role mapping needs strict limits
Group claims make it easy to grant permissions to whole teams at once. A single directory group might give twenty developers write rights to production databases. This creates a large blast radius if an attacker steals a session token. Teams often struggle to audit which person ran a specific query or command. The target system only sees the shared role mapped from the identity token.
Token lifetimes also create risk when you set up single sign-on. If a refresh token lasts all day, revoking a group takes too long. A user keeps their active session until the current token expires on its own. You should set short token lifetimes and map groups to read-only roles first. Only grant write roles when a user has a clear task to finish.
Keycloak + OpenID Connect (OIDC): architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What identity providers leave open in daily operations
An OpenID Connect setup does a great job of checking who logs in. It stops unknown users at the door and proves user identity with math. Still, Keycloak steps out of the way once the login check finishes. The identity provider cannot see what the user does inside the session itself. It does not inspect SQL queries, shell commands, or API calls in flight.
If an engineer has a valid token, they can run a bad delete query. They can also pull tables full of emails, phone numbers, and card numbers. Native login checks cannot rewrite those sensitive fields in the query results. They also cannot pause a risky command to ask a peer for approval. Securing your stack requires controls that watch each action after login succeeds.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
What is the difference between a Keycloak realm and a client?
A realm is a top-level space that holds a set of users and roles. A client is a single app or database tool that asks the realm to log users in.
How do you pass user roles in an OpenID Connect token?
You set up a protocol mapper inside your Keycloak client settings. This mapper reads the user's realm roles or groups and writes them into the ID and access tokens.
Does Keycloak log the commands a user runs after logging in?
No, Keycloak only logs login events, token refreshes, and password changes. It has no view of the queries or commands a user runs inside the downstream app.
Related guides
In this post