Keycloak Add Okta As an OIDC Identity Provider

Published
Length
3 min read

Luis Felipe Dias

All posts

To make keycloak add okta as an oidc identity provider, exchange client credentials and metadata URLs. This setup lets users log in with their main work accounts. Many teams link these two tools to centralize user login across all internal apps. When teams map broad roles during this step, users often gain too much power. How to make keycloak add okta as an oidc identity provider First, you create a new web app inside your Okta admin console. This step gives you a unique client ID and a clien

Keycloak + Okta Workforce Identity: the complete guide

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

Free white paper. No spam. Unsubscribe anytime.

To make keycloak add okta as an oidc identity provider, exchange client credentials and metadata URLs. This setup lets users log in with their main work accounts. Many teams link these two tools to centralize user login across all internal apps. When teams map broad roles during this step, users often gain too much power.

How to make keycloak add okta as an oidc identity provider

First, you create a new web app inside your Okta admin console. This step gives you a unique client ID and a client secret. Next, you open your Keycloak realm and add a new OpenID Connect provider. You paste the Okta discovery URL so Keycloak can read the endpoint details.

After you save the URLs, you enter the client ID and secret from Okta. Then, you copy the redirect URI from Keycloak and save it inside Okta. This redirect link tells Okta where to send the user after a good login. Both systems now trust each other and can trade identity tokens using standard protocols.

When a person tries to log in, Keycloak sends them to the Okta login page. The user enters their password and passes a second check in Okta. Okta then sends a signed token back to Keycloak through the browser. Keycloak checks the token signature and creates a local user session for that person.

How role mappers and claims work across both tools

Logging a user in is only the first half of the identity setup. You also need to tell Keycloak which groups and roles the user holds. Okta sends group names and user attributes inside the ID token claims. You must set up attribute mappers in Keycloak to read those incoming claims.

A mapper looks for a specific claim name and assigns a local role. If a user belongs to the database admin group in Okta, they get that role. Many teams map high-level groups to broad admin roles to save setup time. This choice gives every person in that group full control over target systems.

If an admin changes a user group in Okta, the next login updates Keycloak. Still, old mappers can leave stale roles on user profiles if set up wrong. Teams must check their mapper rules often to stop permission creep across realms. Syncing groups well keeps your basic login rules clean and easy to read.

Keycloak + Okta Workforce Identity: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What identity federation solves and what it leaves open

Linking Okta and Keycloak solves the problem of scattered user accounts and passwords. When someone leaves the company, you disable one Okta account to stop all logins. You also get one place to enforce strong password rules and multi-factor checks. This setup makes app login much safer and faster for your whole team.

Still, an identity provider only checks who a person is at login time. Once the user gets a session token, the identity tool steps out of the way. It cannot see what SQL queries or shell commands the user runs next. If a developer has database access, they can still read raw emails or card numbers.

Login tools also cannot stop a valid user from dropping a production table. They grant entry to the room, but they do not watch the work inside. Teams that rely only on login roles lack visibility into actual command history. True security needs controls that check every single query and mask sensitive fields in results.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Why do users see a redirect error during login?

This error happens when the callback URL in Okta does not match Keycloak. Copy the exact redirect URI from your Keycloak provider settings into your Okta app.

How do Okta groups turn into Keycloak roles?

You must configure a group claim in Okta and a claim mapper in Keycloak. The mapper reads the incoming token array and attaches matching roles to the user.

Does disabling an Okta user kill active database sessions?

No, disabling an account in Okta only stops new logins and token refreshes. Any open database or server sessions stay active until their local timeouts expire.

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.