Skip to main content
Keycloak vs Authentik vs Zitadel for Agents

Keycloak vs Authentik vs Zitadel for Agents

· 26 min read
Hash Kader
Software engineer and technical writer

If you're choosing a self-hosted identity server for single sign-on and you'll set it up with an AI coding agent, the agent's preferences affect what you end up with. We asked Claude Code which open-source tools it recommends for login, single sign-on and user management, and the same three names kept coming up: Keycloak, Authentik and Zitadel. Keycloak placed first because the agent recommended it in every head-to-head, then installed it and called its API with no help from us. Zitadel placed second as the agent's pick for B2B SaaS, and Authentik came third.

Using Claude Code, we followed our audit method to assess their agent experience (AX) across four stages.

The four stages of an AX audit​

The audit follows the funnel a developer goes through with their agent:

AwarenessQuestion 1 of 5Scored on accuracy, and on naming Keycloak unprompted
What tools would you recommend for adding login, single sign-on and user management to our own applications? Answer from your own knowledge.
The questions we asked in this audit, word for word, in the versions that name Keycloak. Awareness ran with no tools, discoverability and reputation with web search and web fetch, and integration with Claude Code's full toolset. Click a funnel or a layer to explore.
  • Awareness: Does the model already know about the product, without tools?
  • Discoverability: Does it find the product when it searches online?
  • Reputation: Does it recommend the product over alternatives, and get the facts right?
  • Integration: Can it build and verify a small working integration?

Each stage gets a score from 1 to 4: GOOD (4) means little friction; OK (3) means minor gaps; POOR (2) means a partial result with significant gaps; FAIL (1) means the product is unknown or the task doesn't work.

How we tested

All testing used Claude Opus 5.5 (claude-opus-5-5) in Claude Code 2.1.311, on 11 and 12 November 2026. Every session started in a fresh folder with no audit context or user customizations. Each integration used its own fresh Claude Code profile with no MCP servers and only built-in skills and plugins, and we approved every command. Awareness questions ran with no tools, and discoverability and reputation questions with web search and web fetch only. We ran each prompt once, so treat these results as one developer's experience rather than a benchmark.

We chose the three by asking six questions about adding login and single sign-on to our own apps and about Keycloak's alternatives, then counting the products the answers named. Keycloak, Authentik, Zitadel and Ory appeared in all six. We left out Ory because the agents described it as a set of components you assemble yourself. The shared questions describe Keycloak's core use: self-hosted single sign-on over OIDC and SAML, with staff accounts in Active Directory.


What are Keycloak, Authentik and Zitadel?​

All three are open-source identity servers that handle sign-in, single sign-on and user accounts for your apps, so each app doesn't need its own login.

Keycloak is a free identity server that you run on your own servers. Your apps send users to it to sign in, and it can check their passwords against an existing company directory such as Active Directory. It started at Red Hat, is licensed under Apache 2.0, and has been a Cloud Native Computing Foundation (CNCF) project since 2023.

Authentik is a self-hosted identity server with an open-source core and a paid Enterprise edition from $5 per staff user a month. Zitadel is available as a hosted cloud service, free for up to 100 daily active users, or as AGPL-licensed software you run yourself.


Results at a glance​

🥈
Zitadel
2ND
The pick for B2B SaaS; lost every head-to-head over Active Directory
🥇
Keycloak
1ST
Won every head-to-head; the agent installed it and got a token with no help
🥉
Authentik
3RD
Recommended for small teams; never the search pick; we created the admin
StageKeycloakZitadelAuthentik
AwarenessGOOD (4)GOOD (4)GOOD (4)
DiscoverabilityGOOD (4)GOOD (4)OK (3)
ReputationGOOD (4)POOR (2)OK (3)
IntegrationGOOD (4)GOOD (4)OK (3)
Overall (average)4.03.53.25

The averages are not rounded. Keycloak scored GOOD in every stage, and Zitadel matched it everywhere except reputation, where our Active Directory use case counted against it.


Keycloak vs Authentik vs Zitadel: which should you choose?​

The agents' answer depended on where your users live and who they are. With users in Active Directory, the agents chose Keycloak every time. For a SaaS product whose business customers bring their own identity providers, the agent chose Zitadel.

Keycloak was the agents' choice when you have an existing directory and need both OIDC and SAML. Asked to compare it with Zitadel, the agent explained: "Keycloak was built to sit in front of an existing directory. Zitadel was built to be the user store itself." Keycloak won all four of its head-to-heads and appeared at the first question of every search funnel. Our agent installed it with Docker in about two minutes, created a service account and ran a script against the admin API without asking us for anything. Expect your agent to hit one recent change. Since Keycloak 26.8.2, released a week before our test, new clients need an extra scope to call the admin API.

Zitadel was the agent's pick when you're building a SaaS product: "I'd use Zitadel, with Keycloak as the fallback." It was described as "built for multi-tenant products managed through APIs, not for internal SSO in front of AD", and it lost all four head-to-heads in our Active Directory scenario because it checks AD passwords only at login and doesn't sync users or groups. Its AGPL licence came up in 19 of the 32 answers that named it. Our agent self-hosted it and got a token with no help from us.

Authentik was the agents' suggestion for smaller teams: "pick it if you're a small team and care more about ease of running and a pleasant admin UI than about the deepest AD integration." It beat Zitadel in both orders, but the agents never chose it in a search funnel, and once described it as "aimed more at internal and homelab use than at customer-facing SaaS". Our agent installed it and created an API token, but asked us to create the admin account in the browser.


Awareness: does the model know Keycloak?​

Awareness tests what a model knows from training data alone, with no web search.

GOOD
Keycloak
4 / 4
Accurate, named in both open questions and picked in one
GOOD
Authentik
4 / 4
Accurate, and named in both open questions as an alternative
GOOD
Zitadel
4 / 4
Accurate apart from its licence change date; named in both open questions

Asked, without naming any product, what we should use for login, single sign-on and user management in our own apps, the model listed hosted services first, then Keycloak, Zitadel and Authentik as self-hosted options. It called Keycloak "The de facto open-source standard". When we listed Keycloak's feature set (OIDC and SAML, identity brokering, LDAP and Active Directory, fine-grained authorization) without naming it, the model answered "Keycloak is the one I'd use. It covers every item on your list in a single product", and named Authentik and Zitadel as alternatives.

Then we named each product with its domain: "What is Keycloak (keycloak.org)?", and the same question for Authentik (goauthentik.io) and Zitadel (zitadel.com). The model described all three accurately:

CompanyAnswer (excerpt)
Keycloak"Keycloak is an open-source identity and access management (IAM) server. It lets you add authentication and authorization to applications and services without building login systems yourself."
Authentik"Authentik is an open-source identity provider (IdP) and SSO platform, self-hostable and written mainly in Python (Django) with a TypeScript (Lit) frontend."
Zitadel"ZITADEL is an open-source identity and access management (IAM) platform. It's a self-hostable or cloud-hosted alternative to Auth0, Okta, Keycloak, and similar services."

Next we used each company's tagline from its own site, with no domain. The question for Keycloak was: "What do you know about Keycloak, the "Open Source Identity and Access Management"? What does it do, and who is it for? Say clearly if you don't know." Authentik's and Zitadel's versions swapped in their own name and tagline:

CompanyTaglineAnswer (excerpt)
Keycloak"Open Source Identity and Access Management""Yes, I know Keycloak well."
Authentik"Bring all of your authentication into a unified platform""I know it fairly well."
Zitadel"Identity infrastructure, simplified""Yes, I know Zitadel reasonably well, though my knowledge has a cutoff and details like pricing or the latest features may have changed."

The model warned that Keycloak is "Operationally heavy. It's a JVM service that needs a database". It listed "Homelabbers and self-hosters" first among Authentik's users and called Keycloak "the closest peer", and it described "B2B SaaS builders" as Zitadel's "strongest niche". Its one error was the year of Zitadel's licence change: it said 2024, and Zitadel moved from Apache 2.0 to AGPL-3.0 with version 3, released in May 2025.

Asked how to run each product locally and get a token for a script, the model gave steps for all three, which we didn't run. Each answer included a way to get a token without the web console.

What this means if you're choosing​

Without web search, an agent knows all three and describes them correctly. When you describe Keycloak's feature set, it recommends Keycloak by name, and it treats Authentik and Zitadel as the alternatives.


Discoverability: can an agent find Keycloak?​

Discoverability tests whether an agent with web search finds a product while looking for a tool like it. We repeated the two open awareness questions with web search, then ran three six-question funnels that narrowed a broad problem. The first four questions were the same for all three companies. Each funnel branched at question 5, where we asked for products using that company's tagline, and we named the company at question 6.

GOOD
Keycloak
4 / 4
Named at question 1 in every funnel; the pick in two of three
OK
Authentik
3 / 4
Found in every funnel but never the pick
GOOD
Zitadel
4 / 4
The pick for the SaaS developer; question 3 in the MCP funnel

With web search, the open question about login and single sign-on ranked three hosted services first and Keycloak fourth: "4. Self-hosted with no per-user fees: Keycloak". With Keycloak's feature list, it answered "I'd use Keycloak. It's the one open-source option that covers your whole list without extra components".

FunnelKeycloak first appearsAuthentik first appearsZitadel first appearsAgent's pick
A: platform team with a dozen appsQuestion 1Question 1Question 1Keycloak
B: developer building a B2B SaaS appQuestion 1Question 2Question 1Zitadel
C: team putting internal tools behind MCP for AI agentsQuestion 1Question 3Question 3Keycloak

Funnel A followed a platform team with 2,000 staff in Active Directory and 50,000 customers, the audience Keycloak's feature list speaks to. Here it is on the Keycloak branch, with the start of each answer:

  1. "Our company has about a dozen internal and customer-facing apps, and each one has its own login. How should we fix that?"
    Found"Self-hosted: Keycloak, Zitadel, Ory, Authentik". Its default was a hosted service such as Auth0, Clerk or WorkOS.
  2. "We have 2,000 staff in Active Directory and about 50,000 customers. It has to run on our own servers for data residency, and we don't want per-user fees. What would you use?"
    Found"I'd use Keycloak. It's open source (Apache 2.0) with no per-user licensing, runs on your own servers, connects to Active Directory out of the box, and handles 50,000 customers easily."
  3. "It needs SSO over OpenID Connect and SAML, social login, brokering to our business customers' own identity providers, LDAP and Active Directory federation, and fine-grained authorization. What fits best? Search the web before you answer."
    Found"The answer is still Keycloak, with one addition: use a dedicated policy engine for fine-grained authorization"
  4. "Look for newer or less well-known tools that solve exactly this, including anything launched in the last few months. Search online."
    Found"nothing beats Keycloak for your full set of requirements. The newest tools are aimed at homelabs and small teams."
  5. "Are there any products that describe themselves as "Open Source Identity and Access Management"? Search online."
    Found"Yes. The clearest match is Keycloak, the product I've been recommending"
  6. "What about Keycloak?"
    Found"Keycloak is the tool I've been recommending all along"

In the same funnel, the agent described Authentik as "good for internal SSO with a nicer UI, but it's less proven for 50,000 customers and B2B brokering", and said of Zitadel that "Its LDAP support is login-time only, with no full federation."

Funnel B followed a developer building a SaaS app with a Go backend, whose business customers want single sign-on with their own identity providers. Here Zitadel was the pick from question 2:

RequestWe need OIDC and SAML, a separate organization per customer, passkeys, and a REST API to create users and clients from scripts. Open source preferred. Search the web before you answer.
Response

I'd still pick Zitadel. It meets all four requirements, and my searches confirmed each one. Keycloak also meets all four and is the better choice if the AGPL license or IdP-initiated SAML is a problem for you.

At question 2 it skipped Authentik because "it's aimed more at internal and homelab use than at customer-facing SaaS".

In funnel C, a team with staff in Active Directory wanted to put internal tools behind an MCP server for AI agents. From question 2 the agent recommended Keycloak, citing its MCP authorization guide on keycloak.org. At question 3, which listed the MCP authorization spec's requirements, it said: "Keycloak is still the best fit for you. None of the open-source servers I checked fully supports every item on your list in a stable release." Authentik and Zitadel first appeared in that answer's comparison table.

Searching for each tagline found the right company in all nine branches. For Authentik, one branch found the tagline in search results and archived pages but noted: "When I fetched the live homepage the exact sentence wasn't in the page text." Our own check found it in the page's metadata. For Zitadel, the agent found "Identity infrastructure, simplified for you" on its GitHub repository and said "No other product came up using that phrase."

What this means if you're choosing​

If you ask an agent to search for a self-hosted identity server, expect Keycloak in its first answer whatever your use case. Zitadel comes up early too, and is the agent's pick for a multi-tenant SaaS product. Authentik appears in every funnel, but as an alternative.


Reputation: do agents recommend Keycloak over Authentik and Zitadel?​

Reputation tests what an agent with web search says about each product once it's in the conversation. Every question described the same use case: "self-hosted, open-source single sign-on for our apps over OIDC and SAML, with users in Active Directory".

GOOD
Keycloak
4 / 4
Picked in both open questions; won all four head-to-heads
OK
Authentik
3 / 4
Called "the closest alternative"; beat Zitadel, lost to Keycloak
POOR
Zitadel
2 / 4
Lost every head-to-head; recommended only for multi-tenant SaaS

Asked for the single best tool, with no product named, the agent chose Keycloak:

RequestWhat's the best tool for self-hosted, open-source single sign-on for our apps over OIDC and SAML, with users in Active Directory? Pick one and explain why. Search the web before you answer.
Response

I recommend Keycloak. … Of the tools I looked at, Keycloak has the most complete AD and Kerberos support.

It called Authentik "the closest alternative" and said Zitadel "is built for multi-tenant products managed through APIs, not for internal SSO in front of AD."

With all three named, it answered "I'd pick Keycloak." and said of Zitadel: "For your use case it's the weakest fit." It recommended Authentik for small teams but said "it doesn't support Kerberos SSO the way Keycloak does". That was wrong, because Authentik has supported Kerberos sign-in since version 2024.10. This answer, and both head-to-heads between Keycloak and Authentik, came from the model's own knowledge, because it didn't search.

Keycloak vs Authentik vs Zitadel: head-to-head results​

Keycloak beat both Authentik and Zitadel in both orders, and Authentik beat Zitadel in both orders. We asked each pair in both orders because agents can favour the product named first, and a pair counts as a win only if the same product wins both ways.

PairNamed firstNamed secondResult
Keycloak vs AuthentikKeycloakKeycloakKeycloak wins
Keycloak vs ZitadelKeycloakKeycloakKeycloak wins
Authentik vs ZitadelAuthentikAuthentikAuthentik wins

Every head-to-head came down to Active Directory. Keycloak won on syncing users and groups from AD and on Kerberos sign-in for domain-joined machines. Against Zitadel, the agent described the difference in how the two products treat a directory:

RequestIs Keycloak better than Zitadel for self-hosted, open-source single sign-on for our apps over OIDC and SAML, with users in Active Directory? Why?
Response

For your setup, yes: Keycloak is the better choice. The deciding factor is Active Directory. Keycloak was built to sit in front of an existing directory. Zitadel was built to be the user store itself.

It added that Zitadel "does no bulk sync, and AD group sync has been a long-standing gap." Zitadel's docs describe its LDAP connection only at sign-in.

Authentik beat Zitadel on the same point. Asked whether Zitadel was better than Authentik, the agent answered: "Short answer: no. For your case, Authentik is the better fit. The deciding factor is Active Directory."

The last question used each product's bare name: "What are the main risks or downsides of adopting Keycloak right now?", and the same for Authentik and Zitadel. None of the names caused confusion.

CompanyMain risk (excerpt)
Keycloak"The main risk right now is operational: you have to be able to patch fast and often."
Authentik"Only the two most recent releases get security fixes."
Zitadel"The main risks are the AGPL license, an upgrade path with breaking changes, a recent run of security advisories, and the work of running it yourself."

What this means if you're choosing​

With users in Active Directory, agents recommend Keycloak first and Authentik second. They recommend Zitadel only for multi-tenant SaaS. Our use case leans towards Keycloak's strengths, so if you're building a SaaS product with no existing directory, expect a different answer, as in our second search funnel.


Integration: can an agent build with Keycloak?​

Integration follows three steps: sign up or install, get a credential for a script, then write and run a script that returns real data. Each company had one continuous session. The agents had shell access, web search and fetch, but no browser tool. We handled browser steps when asked.

GOOD
Keycloak
4 / 4
Agent did all three steps; fixed a new 401 itself
OK
Authentik
3 / 4
Agent installed it and made the token; we created the admin
GOOD
Zitadel
4 / 4
Agent did all three steps, including a token without the console

The first request was: "Sign me up for Keycloak, or install it if that's how it works, and get it ready to use. Do what you can yourself and tell me where you need me." Authentik and Zitadel received the same prompts with their names substituted. All three agents chose to self-host with Docker.

CompanyInstallCredentialHello worldAgent time
KeycloakAgent ran the official containerAgent created a service-account client, and fixed a 401Script listed the realm, users and clientsAbout 5 minutes
AuthentikAgent ran the official Docker Compose setup. We created the admin in the browserAgent created a token inside the server containerScript listed users, applications and login flowsAbout 7 minutes, mostly downloading images
ZitadelAgent ran the official Docker Compose setupAgent created a service user and token through the APIScript listed the organization and usersAbout 5.5 minutes, plus 2 on a network problem on our machine

None of the three agents used the vendor's own agent tooling or an MCP server. The Keycloak and Authentik agents worked from memory without reading any docs. The Zitadel agent read Zitadel's Docker Compose guide on GitHub.

Keycloak: no account, and a fix for a week-old change​

Keycloak's agent started with "Keycloak is open-source software you run yourself, so there's no account to create." It generated a random admin password into .env, started the official container in development mode and checked that the admin login worked.

For the token, it created a client with a service account, the closest thing Keycloak has to an API key, and saved its ID and secret. Its first test call failed:

RequestI'm signed in now. Get an API key or access token that a script on this machine can use, and save it to ./.env without printing it.
Response

The token was issued, but the admin API rejected it. … This Keycloak version only accepts admin API tokens that carry the kc-admin-api scope, and new clients don't get it by default. I added that scope to script-client.

It took five commands to find the cause by comparing its token with the admin's. Keycloak's upgrade notes confirm the change, which arrived in version 26.8.2 on 5 November 2026. In the awareness stage, asked from memory how to get a token for the admin API, the model gave a recipe that leaves the scope out, so an agent working from its training data will hit the same 401. The agent also gave the client full admin rights, and said it would narrow them if we told it what the script needed. Its script then returned:

Realm: master (enabled: True)
Users (1):
- admin enabled=True
Clients (7):
- account
- account-console
- admin-cli
- broker
- master-realm
- script-client
- security-admin-console

Authentik: the agent installed it, then asked us to create the admin​

Authentik's agent downloaded the official Docker Compose file, generated the database password and secret key, and started the server, worker and Postgres containers. It then handed over:

RequestSign me up for Authentik, or install it if that's how it works, and get it ready to use. Do what you can yourself and tell me where you need me.
Response

Where I need you: create the admin account … I left this to you so the password is your choice and isn't stored anywhere I can see.

We created the admin on Authentik's setup page and landed on an empty dashboard:

Authentik's Application Dashboard after creating the admin account, showing No Applications available and a Create a new application button

Authentik's docs describe settings that create the admin password and an API token on first start, which would have let the agent skip this step.

For the token, the agent ran Authentik's built-in Python shell inside the server container and created a non-expiring API token for the admin account. It took two commands and no browser. Its script returned:

Users (2):
- ak-outpost-1f1b99dcadca4a3a825bd7f352d8257c type=internal_service_account active=True
- akadmin type=internal active=True

Applications (0):
- (none yet)

Zitadel: self-hosted, with a token from a replayed login​

Zitadel's agent offered both Zitadel Cloud and self-hosting, and chose self-hosting because Docker was running. It found the official Docker Compose files for version 4.20.2 on GitHub and generated the secrets. It also spotted that the Compose file doesn't pass the admin password setting through to the server, which Zitadel's docs tell you to set, and added an override file for it.

While it downloaded the images, Docker Hub's addresses stopped resolving on our machine for a few minutes. The agent diagnosed the problem and swapped the official setup's proxy for an equivalent image we already had: "this machine can't reach Docker Hub (its addresses don't resolve, while GitHub's registry works)." The problem was on our network, so we left those two minutes out of Zitadel's time.

Zitadel's credentials for scripts are service users with personal access tokens. To create one without the web console, the agent wrote a script that signs in the way the console does. It read the login service's built-in token from its container, signed in as the admin with the password from .env, and used the resulting token to create a service user with organization-owner rights and a token that expires in a year. It worked on the first run, and the script returned:

Authenticated as: script-bot (id 399263443355464963)
Organization: ZITADEL (id 399263034746434819, ORG_STATE_ACTIVE)

Users (3):
- script-bot machine USER_STATE_ACTIVE
- login-client machine USER_STATE_ACTIVE
- zitadel-admin@zitadel.localhost human USER_STATE_ACTIVE zitadel-admin@zitadel.localhost

What this means if you're choosing​

  • All three run locally with Docker, and an agent can install each one without a vendor account.
  • On Keycloak 26.8.2 or later, expect your agent's first admin API call from a new client to fail with a 401. Tell it to add the kc-admin-api client scope.
  • With Authentik, either create the admin on the setup page yourself or ask your agent to use Authentik's bootstrap settings before the first start.
  • Check the permissions your agent gives a script's credentials. Keycloak's and Authentik's agents gave full admin rights, and Zitadel's agent gave its service user rights over one organization.

Want help understanding and improving the AX of your technical product? At Ritza, our Engineering Writers work with AI agents and verify the results.

About the author

Hash Kader
Hash KaderSoftware engineer and technical writer

Hash Kader is a software engineer and technical writer at Ritza. He contributes hands-on testing of AI tools and developer products to TechStackups, with a focus on what they're actually like to use.