Keycloak Supported Protocols

Published
Length
3 min read

Luis Felipe Dias

All posts

The main keycloak supported protocols are OpenID Connect, OAuth 2.0, and SAML 2.0. You set up these login rules by picking a protocol for each client app. Most teams start by linking all internal apps to one central realm. They assign broad group roles so engineers can get to work fast. When those roles stay too wide, users gain far more power than they need. One login token can then open up production databases and core cloud tools. How keycloak supported protocols work in practice Keycloak

Keycloak + Emergency Access Protocols: the complete guide

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

Free white paper. No spam. Unsubscribe anytime.

The main keycloak supported protocols are OpenID Connect, OAuth 2.0, and SAML 2.0. You set up these login rules by picking a protocol for each client app. Most teams start by linking all internal apps to one central realm. They assign broad group roles so engineers can get to work fast. When those roles stay too wide, users gain far more power than they need. One login token can then open up production databases and core cloud tools.

How keycloak supported protocols work in practice

Keycloak acts as a central identity server for your web apps and services. When a user tries to log in, the app sends them to Keycloak. The server checks who the user is and sends back a signed proof. The format of that proof depends on the protocol you pick for the app.

OpenID Connect is the top choice for modern web and mobile apps. It sits on top of OAuth 2.0 and uses JSON tokens for identity. When a user logs in, the server issues an identity token and an access token. The app reads these tokens to learn who the user is and their roles. Teams also use this flow to log users into cloud consoles and Kubernetes clusters.

OAuth 2.0 handles permissions between services and APIs. It lets one app act on behalf of a user or another service. Backend tools use it to pass scoped tokens with each web request. The receiving API checks the token signature before it runs the request.

SAML 2.0 serves older enterprise tools and third-party vendor apps. Instead of JSON tokens, SAML sends signed XML messages between the browser and the server. Many legacy corporate portals still rely on SAML to check user group memberships.

Mapping roles and identity claims across protocols

Regardless of the protocol you choose, the server maps user traits into the login response. Admins group users by team and tie specific role labels to those groups. When the login finishes, the protocol packs those role labels into the token or XML assertion. The target tool reads those claims and grants matching permissions inside its own system.

Keycloak + Emergency Access Protocols: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Teams often sync user lists from an existing corporate directory using LDAP or Active Directory. They can also link external social logins or partner identity systems to the same realm. The server translates between these systems so apps only need to speak one protocol. A legacy SAML app and a modern OpenID app can share one login session.

What identity protocols solve and what they leave open

Central login protocols solve a major security problem for growing teams. They remove scattered local passwords and let admins turn off accounts in one place. You can enforce multi-factor login rules for every user across every connected app. Audit logs in the identity server show who logged in and when it happened.

Still, login protocols only check identity at the front door. Once a token is issued, the identity server steps out of the way. It cannot see what queries an engineer runs inside a database session. It cannot block a risky command inside a production shell or a cloud CLI. If a role allows write permissions, the user can drop tables or read raw customer rows. Also, standard protocols do not mask sensitive fields like emails, phone numbers, or card numbers in query results. Teams still need controls that watch and filter actions after the login check passes.

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

Which login protocol should I pick for a new app?

Pick OpenID Connect for almost all new web, mobile, and CLI tools. It uses compact JSON tokens that are easy for modern code to verify. Keep SAML 2.0 for older vendor apps that do not support OpenID Connect.

Can one realm run OpenID Connect and SAML 2.0 at the same time?

Yes, a single realm can handle both protocols at once for different apps. A user can log in once via OpenID Connect and open a SAML app right away. The server translates the session state behind the scenes without asking for a password again.

Do login protocols control what users do inside a database or server?

No, login protocols only verify who the user is and pass along role names. They do not inspect SQL queries, shell commands, or API payloads during the session. You need runtime session controls to approve commands or mask sensitive data fields.

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.