Keycloak vs Ory: Which Open Source Identity Stack Fits You

Guilliano MolaireGuilliano MolaireUpdated 14 min read

Keycloak is a single, all-in-one identity provider: one service with a built-in login page, an admin console, SAML, LDAP and Active Directory federation and, since 26.8, a supported SCIM API. Ory is a headless set of Go services (Kratos for identities, Hydra for OAuth2 and OpenID Connect, Keto for permissions, Oathkeeper as an access proxy, plus Polis for SAML and SCIM) where your team builds the login UI and wires the pieces together. Choose Keycloak when you want to ship enterprise single sign-on in days with one cluster to run. Choose Ory when you want API-first building blocks, will own the user-facing experience, and either have the engineering time to operate several services or plan to pay for Ory Network.

Both projects are open source, and each repository publishes its license file (Keycloak, Kratos). Both are certified OpenID Connect providers: Keycloak 18.0.0 “is re-certified as OpenID Connect Provider” per Keycloak’s announcement, and the Hydra documentation states that “Ory OAuth2 and OpenID Connect is a Certified OpenID Connect Implementation that meets all requirements set by the OpenID Foundation” (Ory Hydra docs). Both are actively maintained. The decision is not about which one is “better” but about which shape of work your team wants: configuring a product, or assembling infrastructure.

The one-screen decision table

Question Keycloak Ory
What you deploy One service plus a database (supported databases) Kratos, Hydra, Keto and Oathkeeper as separate services, each with its own database and config, plus Polis for SAML and SCIM, plus the login and consent app you write
Login UI Built in and themeable; account console included (server admin guide) Not shipped: Kratos “is API-only; it doesn’t have a UI or HTML templating engine” (Kratos quickstart); Ory Elements gives you React and Next.js components to start from
Admin console Full web console CLI and APIs in open source; the console comes with the Enterprise License or Ory Network (open source page)
SAML 2.0 Identity provider and broker, native Through Ory Polis, a separate service (Polis docs); Ory’s feature table lists SAML, OIDC and directory sync under its Enterprise License and Network, not open source (open source page)
LDAP and Active Directory “User Federation - Sync users from LDAP and Active Directory servers” (server admin guide) No connector: Kratos’s documented credential types are password, passkey, code, OIDC, SAML, WebAuthn, TOTP, lookup secrets and device keys, with no LDAP entry (Kratos credentials)
SCIM 2.0 Native, supported since 26.8 (release notes) and listed as scim-api in the supported, enabled-by-default features (features guide) Directory sync in Polis (repository), listed under Enterprise and Network in Ory’s table
Token exchange (RFC 8693) Standard token exchange (token-exchange-standard) supported; delegation in preview (features guide, release notes) Listed as Enterprise and Network only (open source page)
Passkeys Supported, on by default (passkeys in the features guide) Passkey and WebAuthn strategies in Kratos (Kratos docs)
Fine-grained authorization Authorization Services: user, role, group, client, client scope, time, regex, aggregated and JavaScript policies, plus a Protection API the guide calls “a set of UMA-compliant endpoint-providing operations for resource servers” (authorization guide) Keto: relation tuples in the notation of Google’s Zanzibar paper (Keto docs)
Team profile Wants SSO working this week; has or will hire some Java familiarity for extensions Go or Kubernetes team that wants to own every screen and API call
Managed option Managed Keycloak providers, including Skycloak Ory Network, billed per active user per month

The rest of this post explains each row, what it costs in practice to run either stack, and the cases where Ory is the better choice.

What is the real architectural difference?

Keycloak treats identity as a product. You run the container image, point it at PostgreSQL, create a realm (Keycloak’s word for an isolated tenant with its own users, clients and settings), and you have a login page, registration, password reset, multi-factor enrollment, an account console for users and an admin console for operators. The server administration guide lists “OpenID Connect support”, “SAML support”, “User Federation - Sync users from LDAP and Active Directory servers” and “Identity Brokering - Authenticate with external OpenID Connect or SAML Identity Providers” among its features. Customization happens through themes, authentication flow configuration and Java extension points called SPIs (Service Provider Interfaces). You get a lot for free, and you work inside Keycloak’s model to get it.

Ory treats identity as infrastructure. Each concern is its own HTTP service, and your application calls them. The split matters because it decides what you build:

  • Kratos stores identities and runs the self-service flows: registration, login, logout, multi-factor authentication, settings, verification and recovery. Identities follow a JSON schema you define, so a customer with two email addresses and a staff member with a cost center can live in the same system (Kratos concepts). Kratos does not issue OAuth2 tokens.
  • Hydra is the OAuth2 and OpenID Connect server. Its guide says it “doesn’t contain a database with end users but instead uses HTTP redirection to ‘delegate’ the login flow” (login and consent guide). That app is yours, and it usually talks to Kratos.
  • Keto answers permission checks over relation tuples, the model from Google’s Zanzibar paper. A tuple such as Document:readme.txt#readers@User:user2 is an edge in a graph, and a check walks that graph (relation tuples).
  • Oathkeeper is a reverse proxy or decision API that matches a request against access rules, authenticates it, authorizes it and mutates headers before it reaches your upstream (Oathkeeper docs).
  • Polis, “formerly known as BoxyHQ Jackson” (Polis docs), is the piece that speaks SAML and SCIM. It implements SSO “as an OAuth 2.0 flow, abstracting away the complexities of the underlying SAML or OIDC protocol” (Polis docs) and, per its README, “also supports Directory Sync via the SCIM 2.0 protocol for automatic user and group provisioning/de-provisioning” (ory/polis README).

If you only need a login for your own app, you can run Kratos alone. If you need to issue tokens to third-party clients, you add Hydra and the login and consent app. If you need enterprise SSO, you add Polis. The stack grows with your requirements, and so does the number of things you operate.

How does a single login run on each stack?

Here is the part most comparisons skip. The sequence below is what one browser login looks like on each side, and it is where the “days versus weeks” difference comes from.

One login in Keycloak compared with one login in the Ory stack

In Keycloak your app redirects to Keycloak (1), Keycloak shows its own login page and checks its own user store (2), and returns a code and then tokens (3). In Ory your app redirects to Hydra (1), Hydra sends the browser to the login app you built (2), that app checks the credentials with Kratos (3) and accepts the login challenge at Hydra (4), Hydra sends the browser to your consent app, which accepts the consent challenge (5), and only then does Hydra return a code and tokens (6). The dashed boxes are code you write and deploy.

Hydra’s login and consent guide describes the Ory sequence in eight steps and points at a Node.js example app for custom login and consent. That example and the Kratos quickstart UI are there to show you the API, and the quickstart is explicit that Kratos “is API-only; it doesn’t have a UI or HTML templating engine” (Kratos quickstart). From a relying party’s point of view the result is the same: standards-compliant OIDC with discovery, JWKS and the usual grant types. The difference is how much of the middle you own.

Does Ory support SAML now?

Yes, through Polis, and this is where the older version of this post was wrong to print a flat “No”. Polis is open source under Apache 2.0 and its README describes it as “an Enterprise Single Sign-On (SSO) service for SAML and OIDC identity providers” that “also supports Directory Sync via the SCIM 2.0 protocol” (ory/polis README). In the Ory product, Kratos organizations are its grouping for B2B customers, and the organizations docs say “all members of an organization must use one of the organization’s OIDC or SAML SSO connections to log in”.

Two caveats shape the row in the table. First, Ory’s own open-source comparison table lists Polis’s “SAML & OIDC” and “Directory sync” under the Enterprise License and Ory Network columns, with “No” under open source (open source page). Second, even where you run Polis yourself, it is another service with its own database, in front of a Kratos that does not speak SAML natively. So the fair statement is: Ory can do SAML and SCIM today, but as a fifth service or as a paid feature, while Keycloak does both inside the one server you already run.

Keycloak’s side has moved too. The 26.8.0 release notes say “the SCIM API is promoted from preview to supported”, and the features guide lists scim-api in its table of supported features that are enabled by default; see Keycloak 26.8 SCIM API: supported and on by default. The same 26.8.0 release notes carry a “Client Secret Rotation (supported)” entry (client secret rotation), and state that “token exchange delegation support status is now preview” (token exchange delegation); delegation lets a user consent to an agent acting for them, and Keycloak 26.8 token exchange delegation for AI agents covers it. The features guide lists token-exchange-standard, passkeys, dpop, client-secret-rotation and scim-api in its table of supported features that are enabled by default. On Skycloak these ship as the single sign-on, identity providers and SCIM features of a managed cluster. If a comparison page you read lists any of these as a Keycloak gap, check its date against the 26.8 release notes.

Protocols and standards, side by side

Protocol or feature Keycloak Ory
OAuth 2.0 and OpenID Connect Certified (2022 certifications) Certified, Hydra (Hydra docs)
SAML 2.0 as identity provider or broker Native Polis, a separate service; Enterprise or Network per Ory’s table (open source page)
LDAP and Active Directory federation Native (server admin guide) Not among Kratos’s documented credential types (Kratos credentials)
SCIM 2.0 inbound provisioning Native, supported in 26.8 (release notes) Polis directory sync; Enterprise or Network per Ory’s table (open source page)
Passkeys and WebAuthn Supported, on by default Kratos passkey and WebAuthn strategies
Token exchange Standard exchange supported; delegation preview (release notes) Enterprise or Network per Ory’s table (open source page)
Client secret rotation “Client Secret Rotation (supported)” in the 26.8.0 release notes “Credential rotation” is Enterprise or Network per Ory’s table (open source page)
Device authorization grant Yes Documented in Ory’s device authorization guide (RFC 8628)
Fine-grained authorization Authorization Services Keto

The Open Source Authentication Comparison 2026 puts these two next to authentik, Zitadel, Authelia and the rest if you want the wider field.

Open source, without the per-user bill

Most identity platforms charge per monthly active user and gate enterprise SSO behind an upgrade. Skycloak bills for infrastructure instead, so every plan carries unlimited users and unlimited applications, on real upstream Keycloak you can export at any time.

Permissions: Keycloak Authorization Services or Ory Keto?

Keto’s model is relationships. You write tuples (“user1 is in members of group1”, “group1 is in editors of folder src”, “folder src is in parents of package.json”) and ask whether a subject reaches an object through some relation (Keto docs). That is the right shape for document sharing, nested teams and anything that looks like a file system, and it is what relationship-based access control means in practice.

Keycloak’s Authorization Services evaluate user, role, group, client, client scope, time, regex, aggregated and JavaScript policies, and expose a Protection API that the guide describes as “a set of UMA-compliant endpoint-providing operations for resource servers” (authorization services guide), all inside the same server and admin console. It is more direct when your access model is “this role may do this action on this resource type”, and it needs no extra service. We go through what the engine can and cannot express in Fine-grained authorization in Keycloak explained. If your product genuinely needs a Zanzibar graph, Keto next to Keycloak is a workable combination: Keycloak authenticates and issues tokens, your backend asks Keto.

What does it take to run each stack?

This section is based on Keycloak’s documentation on the one side and on Ory’s own documentation on the other.

A production Keycloak is one Quarkus-based Java process, or several of them behind a load balancer, and a relational database. Clustering is embedded: the distributed cache “is built on top of Infinispan” and, by default, the jdbc-ping stack “uses the configured database to track nodes joining the cluster” (caching guide), so there is no separate cache cluster to run. The things you actually spend time on are:

  • Sizing. Keycloak’s own load-tested guidance is 1 vCPU “for each 15 password-based user logins per second”, 1 vCPU per 120 client credential grants per second, 1 vCPU per 120 refresh token requests per second, plus “150% extra head-room for CPU usage to handle spikes in the load”, and a base memory usage per Pod that the guide puts at “1250 MB of RAM” including realm caches and 10,000 cached sessions (sizing guide). Sizing is driven by request rate, not by how many users you have registered.
  • Upgrades. Keycloak releases often: 26.8.0 (release post, tag) was followed by 26.8.1, whose release page lists a “Security fixes” section with CVE identifiers (26.8.1 release). Each one needs the upgrading guide read for schema migrations, deprecations and theme or SPI changes.
  • Database care. PostgreSQL is the common choice, with connection pooling, backups and restore drills on your side.
  • Edge. Reverse proxy headers, TLS, rate limiting and bot protection in front of the login endpoints.

That is real work, and it is the reason managed Keycloak providers exist. It is also one well-documented service with a large open-source community around it (GitHub). We cover the honest trade-off in Is self-hosting Keycloak worth it in 2026?.

Self-hosting the full Ory stack means operating Kratos, Hydra, Keto and Oathkeeper, each a Go binary with its own configuration, database schema, migrations and release notes (Kratos, Hydra, Keto, Oathkeeper). Add Polis if you need SAML or SCIM, and add your own login, registration, recovery, settings and consent application, which is a deployable with its own release cycle, monitoring and security review. Each Ory service is a single Go binary and is likely to use less memory per container than a JVM process, but you trade one process with one upgrade guide for five or six processes plus an app, and the Ory feature table reserves CVE security patching, 24/7 SLA support, production Helm charts and high-performance pooling for the Enterprise License or Network (open source page).

Effort Keycloak (self-hosted) Ory (self-hosted)
Processes to run 1, plus a database 4 to 5, plus a database each, plus your login and consent app
Frontend work before first login Theme tweaks, or none A login, registration, recovery and settings app; Ory Elements shortens it
Admin tooling Web console CLI and admin APIs
Upgrade cadence One release stream One coordinated stream across several services, plus your app
Enterprise SSO Configure a SAML identity provider in the console Deploy and configure Polis, or buy it
Managed escape hatch Managed Keycloak (what Skycloak handles) Ory Network

If you want Keycloak’s feature set without the operations list above, that is what Skycloak’s managed Keycloak is for, and the hosting page lists what a managed cluster includes.

When Ory is the better choice

It would be easy for a managed Keycloak company to write this section as a list of edge cases, so here are the real ones.

  • You are building the login screens anyway. A consumer product with a design team that will never accept a themed Keycloak page is a good fit for Kratos plus Ory Elements, because the “cost” of building the UI is money you were going to spend.
  • Your product is API-first and polyglot. When every service in your platform is already a small Go binary behind a gateway, Hydra and Oathkeeper fit the pattern and the operations culture you already have.
  • Your authorization model is a graph. Google Docs-style sharing, nested folders and inherited permissions are what Keto was designed for, and Keycloak’s policy engine is the wrong shape for them.
  • Headless by design. Native mobile apps and single-page apps that want JSON flows rather than browser redirects get that from Kratos’s native API flows, including for passkeys (Kratos release notes).
  • You plan to buy Ory Network. If you will pay for the managed service, the operational argument above mostly disappears, and the comparison becomes managed Ory versus managed Keycloak on features and price. Ory Network publishes its plans on its pricing page; Skycloak prices per cluster with unlimited users rather than per user (pricing), and the managed Keycloak providers comparison shows which model each provider uses.

When Keycloak is the better choice

  • Enterprise customers are on the roadmap. SAML, LDAP, SCIM and identity brokering are all native, which means your first enterprise deal does not add a service to your platform.
  • Non-developers will administer identity. An admin console that a support engineer or an IT administrator can use without writing code is worth a lot once the product has customers.
  • You want one thing to run. One process, one database, one upgrade guide, and a community large enough that most problems have a public answer.
  • You are migrating off a commercial IdP. Keycloak’s protocol coverage lets you move existing SAML and OIDC integrations without rebuilding them, which we compare with other open-source options in Keycloak vs Zitadel and Keycloak vs SuperTokens.

Frequently asked questions

Is Ory a Keycloak alternative?

For the OAuth2 and OIDC requirement, yes: both issue standard tokens and both are certified. For the whole product, not quite. Keycloak is one identity provider you configure; Ory is a set of services and an application you assemble. Moving between them means re-architecting how your app handles login, not swapping a configuration file.

Does Ory have a login UI?

Ory does not ship a finished login UI in its open-source services. Kratos exposes the flows as APIs and its quickstart says it “is API-only; it doesn’t have a UI or HTML templating engine” (Kratos quickstart). Ory Elements is an Apache 2.0 licensed (license file) component library that its README says “Works with the React ecosystem (Next.js, plain React)” and that “dynamically adapts the user interface to your Ory Kratos identity schema, sign-in and flow configuration” for the “login, registration, settings, verification, recovery and consent user interface”, so the starting point is better than it was, but it is still your frontend to build, host and maintain. Ory Network adds a hosted account experience.

Does Ory support SAML?

Through Ory Polis, which handles SAML and OIDC identity providers (Polis docs) and SCIM directory sync (ory/polis README). Ory’s feature table lists those capabilities under its Enterprise License and Ory Network (open source page). Keycloak supports SAML 2.0 as an identity provider and as a broker inside the server.

Keycloak vs Ory Hydra: what is the difference?

Hydra is only the OAuth2 and OpenID Connect server. It has no user database and delegates login to an app you write (login and consent). Keycloak is the authorization server, the user store, the login UI, the admin console and the federation layer in one. A fair comparison is Keycloak against Hydra plus Kratos plus your login and consent app.

Can I use Ory Keto with Keycloak?

Yes. Keto is a standalone permissions service with an HTTP and gRPC check API, so your backend can validate a Keycloak token and then ask Keto whether the subject may act on the object. Teams do this when they want Keycloak’s federation and console with a Zanzibar-style graph (Keto docs). If roles and attributes cover your model, Keycloak’s own Authorization Services avoid the extra service; Fine-grained authorization in Keycloak explained shows where that line is.

Which is cheaper to run?

For a small team that wants enterprise SSO, Keycloak usually costs less in engineering time because the login UI, SAML, LDAP and SCIM are configuration rather than code. For a team that was going to build its own UI and already operates many small services, Ory’s per-container footprint is lighter and the extra services fit existing tooling. Both are free to self-host; the managed options, Ory Network and managed Keycloak providers, are where the price lists differ.

What to do next

Write down three things before you pick: whether an enterprise customer will ask for SAML or SCIM in the next year, who will administer users and clients day to day, and whether your team wants to build and own the login screens. If the answers are “yes”, “someone who is not a developer” and “no”, start with Keycloak. If they are “no”, “our engineers” and “yes, and we have the design budget”, prototype Kratos with Ory Elements first and add Hydra only when a third-party client needs tokens.

If you land on Keycloak and do not want to run the cluster, upgrades and backups yourself, see what Skycloak’s managed Keycloak hosting includes.

Open source, without the per-user bill

Most identity platforms charge per monthly active user and gate enterprise SSO behind an upgrade. Skycloak bills for infrastructure instead, so every plan carries unlimited users and unlimited applications, on real upstream Keycloak you can export at any time.

Guilliano Molaire
Written by
Founder, Skycloak

Guilliano is the founder of Skycloak and a cloud infrastructure specialist with deep expertise in product development and scaling SaaS products. He discovered Keycloak while consulting on enterprise IAM and built Skycloak to make managed Keycloak accessible to teams of every size.

© 2026 Skycloak. All Rights Reserved. Design by Yasser SolimanKeycloak™ is a trademark of the Linux Foundation. Skycloak is not affiliated with the Keycloak project.