The best open source SSO solution for most teams is Keycloak: it is free under the Apache 2.0 license, supports OpenID Connect and SAML, and is the most widely deployed open source identity server. Choose authentik for self-hosted internal apps with visual login flows, Zitadel for multi-tenant B2B software, and Authelia for a lightweight login portal in front of apps behind a reverse proxy.
Key takeaways
- Keycloak is the safest general-purpose pick: Apache 2.0, OIDC and SAML, identity brokering, and a huge community.
- Licenses matter as much as features — Zitadel is AGPL-3.0 since v3, while Keycloak, Authelia, and CAS are Apache 2.0.
- Running your own identity provider makes it your most critical service — budget for backups, updates, and high availability.
Every app your team uses wants its own login. Single sign-on fixes that: one identity provider, one login, and every connected app trusts it. The commercial options are expensive, so many teams run an open source identity provider instead — and in 2026 the open source options are genuinely good.
What is the best open source SSO solution?
The best open source SSO solution for most teams is Keycloak. It is free under the Apache 2.0 license, supports OpenID Connect and SAML 2.0, federates users from LDAP and Active Directory, and is the most widely deployed open source identity server, with a community large enough that almost any problem has been solved before.
That does not make it the best choice for everyone. Authentik is easier to run for self-hosted internal apps, Zitadel is designed for multi-tenant software-as-a-service products, and Authelia is lighter than all of them when you only need a login screen in front of apps behind a reverse proxy. Pick by the job, not by the feature count.
What is SSO and how does it work?
Single sign-on (SSO) lets a user sign in once with an identity provider (IdP) and then access multiple applications, called service providers, without signing in again. The identity provider verifies the user, then issues a token or assertion that each application trusts.
Two protocols do most of the work. OpenID Connect (OIDC), built on OAuth 2.0, is the modern default for web and mobile apps and uses JSON tokens. SAML 2.0 uses XML assertions and remains common in enterprises, universities, and older applications. A good identity provider speaks both, so it can connect new apps and legacy ones from the same server. If you ever need to inspect a token your provider issued, our free JWT decoder shows what is inside it.
An identity provider is more than a login page. It stores or federates users, enforces multi-factor authentication, manages sessions and logout, and brokers logins from other providers such as Google, Microsoft, or GitHub. That is why choosing one is a bigger decision than choosing a password manager: it becomes the front door to everything.
The best open source SSO solutions at a glance
All eight projects below are free to self-host. What differs is the license, the protocols, the weight, and the job each one is built for.
| Solution | Best for | License | OIDC | SAML | Starting price |
|---|---|---|---|---|---|
| Keycloak | General-purpose IAM | Apache 2.0 | Yes | Yes | Free to self-host |
| authentik | Self-hosted internal apps | MIT (core) | Yes | Yes | Free; Enterprise from $5/internal user/mo |
| ZITADEL | Multi-tenant B2B SaaS | AGPL-3.0 | Yes | Yes | Free to self-host; cloud free to 100 DAU |
| Authelia | Lightweight proxy login | Apache 2.0 | Yes | No | Free |
| Apereo CAS | Universities, government | Apache 2.0 | Yes | Yes | Free |
| Ory | Headless, API-first auth | Apache 2.0 | Yes | No* | Free to self-host |
| Logto | Customer login for apps | MPL-2.0 | Yes | Yes | Free to self-host |
| Dex | Kubernetes federated login | Apache 2.0 | Yes | No | Free |
* Ory's core is OIDC and OAuth 2.0; SAML support is available through its enterprise offering and connectors. Check the current docs before committing to a protocol.
How we chose these solutions
We only included projects whose source is available under an open license and that are actively maintained in 2026. Each one was judged on protocol coverage, license terms, deployment weight, multi-factor authentication support, and whether it fits a real job: workforce login, a product's identity layer, legacy apps, or infrastructure access.
We did not rank by GitHub stars alone. Stars measure popularity, not fit: the most-starred project can be the wrong choice for a small team that only needs a login portal, and a smaller project can be exactly right for a Kubernetes cluster. Prices below are for self-hosting, which is free for every project here; paid tiers buy managed hosting, support, or enterprise features.
The 8 best open source SSO solutions
Start with Keycloak unless you have a specific reason to pick another one. The entries below explain what that reason would be.
1. Keycloak — best for most teams
Keycloak is the default answer to open source SSO. Originally created at Red Hat and now a Cloud Native Computing Foundation project, it is an identity and access management server that adds authentication to applications with minimum effort. Users authenticate with Keycloak rather than with each application, and once logged in they do not have to log in again to access a different application.
- Protocols: OpenID Connect, OAuth 2.0, and SAML 2.0, plus identity brokering with social and enterprise providers.
- User federation: built-in support for LDAP and Active Directory, with custom providers for other stores.
- Features: admin console, fine-grained authorization services, single sign-out, multi-factor authentication, and organizations for multi-tenancy.
- License: Apache 2.0. Pricing: free to self-host; commercial support is available through the Red Hat build of Keycloak.
Who should pick it: enterprises and growing teams that need the broadest protocol and federation support and a large talent pool. Watch out for: it is a Java application with real operational weight — plan for a database, backups, and high availability from day one.
2. authentik — best for self-hosted internal apps
Authentik is an identity provider designed to be easy to self-host, with a modern admin interface and a visual editor for login, enrollment, and recovery flows. It positions itself as an open source replacement for Okta, Auth0, and Entra ID, and it is the friendliest option in this list for homelabs and small IT teams.
- Protocols: OAuth 2.0 and OpenID Connect, SAML, LDAP, and RADIUS from one server.
- Standout feature: proxy outposts that put SSO in front of applications with no login of their own, plus LDAP and RADIUS outposts for legacy systems.
- Features: visual flow editor, multi-factor authentication, passkeys, and application proxying.
- License: MIT for the core, with enterprise features under a separate license. Pricing: free to self-host; Enterprise is listed at $5 per internal user per month and $0.02 per external user per month, as of November 2026.
Who should pick it: self-hosters who want one identity provider for modern apps, old apps, and apps with no login at all. Watch out for: the open-core model — check which features sit behind the enterprise edition before you depend on them.
3. ZITADEL — best for multi-tenant B2B SaaS
ZITADEL is a cloud-native identity platform built around multi-tenancy. Each of your customers can be an organization with its own users, branding, login policies, and identity providers, which makes it a natural fit for B2B software products that need to offer SSO to their own customers.
- Protocols: OpenID Connect, OAuth 2.0, SAML, and SCIM for user provisioning.
- Standout feature: organizations and delegated administration are first-class concepts, not an add-on.
- Features: passkeys and multi-factor authentication, audit trails, API-first design, and login customization per organization.
- License: AGPL-3.0 since version 3 in 2025, with some directories under Apache 2.0 or MIT. Pricing: free to self-host; managed ZITADEL Cloud is free up to 100 daily active users, with paid tiers above that.
Who should pick it: teams building B2B SaaS where each customer needs their own tenant and SSO. Watch out for: the AGPL license, which requires offering source code to users who interact with the software over a network — get legal advice if you modify it for a commercial product.
4. Authelia — best lightweight option
Authelia is the lightest choice in this list. It is a small open source authentication and authorization server that sits in front of a reverse proxy and adds single sign-on and two-factor authentication to applications that have no authentication of their own.
- Protocols: OpenID Connect as an identity provider, plus forward-auth for reverse proxies such as Traefik, NGINX, and Caddy.
- Standout feature: single-factor and two-factor authentication with per-application access rules, in one small binary.
- Features: TOTP and WebAuthn second factors, LDAP and file-based user backends, and regulation rules per application.
- License: Apache 2.0. Pricing: free; it is a community project with no paid edition.
Who should pick it: homelabs and small teams that run apps behind a reverse proxy and just need a login screen. Watch out for: it is not a full identity platform — there is no SAML support and no user self-service portal like Keycloak's.
5. Apereo CAS — best for universities and government
Apereo CAS, the Central Authentication Service, is the long-running open source single sign-on server for higher education and government. It powers login for universities and research institutions worldwide, and it speaks the protocols those estates already use, including CAS itself, SAML, and WS-Federation.
- Protocols: CAS, SAML 2.0, OpenID Connect, OAuth 2.0, and WS-Federation.
- Standout feature: deep support for academic federations and delegated authentication across institutions.
- Features: multi-factor authentication, delegated login, attribute release policies, and a large extension ecosystem.
- License: Apache 2.0. Pricing: free; commercial support is available from Apereo partners.
Who should pick it: universities, research institutions, and government bodies with CAS, SAML, or WS-Federation estates. Watch out for: configuration is extensive, and the learning curve is steeper than authentik's.
6. Ory — best for headless, API-first auth
Ory is a set of headless building blocks — Kratos for identity, Hydra for OAuth 2.0 and OpenID Connect, and Keto for permissions — for teams that want to own the login interface themselves and drive everything through APIs.
- Protocols: OAuth 2.0 and OpenID Connect, with SAML available through enterprise connectors.
- Standout feature: API-first design: you build your own login pages and flows, and Ory handles the identity logic.
- Features: self-service registration and recovery, social login, multi-factor authentication, and fine-grained permissions with Keto.
- License: Apache 2.0. Pricing: free to self-host; managed Ory Cloud is available.
Who should pick it: product teams that want full control over the login experience and are comfortable building their own UI. Watch out for: there is no bundled admin interface like Keycloak's — you build it or use the APIs directly.
7. Logto — best developer-friendly customer login
Logto is a developer-friendly identity platform for adding sign-in, sign-up, and social login to your own product. It is built for customer identity rather than workforce login, with ready-made sign-in pages and connectors for dozens of social and enterprise providers.
- Protocols: OpenID Connect, OAuth 2.0, and SAML for enterprise connections.
- Standout feature: quick setup with pre-built sign-in experiences and a wide connector library.
- Features: multi-factor authentication, organization and role management, and machine-to-machine authentication.
- License: Mozilla Public License 2.0. Pricing: free to self-host; managed cloud plans are available.
Who should pick it: developers adding login to a customer-facing app who want to move fast. Watch out for: it is younger and smaller than Keycloak, so the community and integration library are thinner.
8. Dex — best for Kubernetes federated login
Dex is a federated OpenID Connect provider, popular in Kubernetes clusters, that connects to other identity providers — LDAP, GitHub, Google, Microsoft, and more — and presents them as one OIDC endpoint to your applications.
- Protocols: OpenID Connect, federating upstream providers via connectors.
- Standout feature: a thin, reliable layer that turns many upstream logins into one standard OIDC login.
- Features: connector library for common providers, refresh tokens, and simple static configuration.
- License: Apache 2.0. Pricing: free.
Who should pick it: Kubernetes teams that need one OIDC login backed by existing providers. Watch out for: Dex is not a user store — it federates other providers rather than managing users itself, so pair it with something that holds your accounts.
How do you choose the right open source SSO?
Match the tool to the job, not to the feature list. Four questions decide it.
- Who is signing in? Workforce login points to Keycloak or authentik; your product's customers point to Zitadel or Logto; infrastructure access points to Dex.
- Which protocols must you speak? If a legacy app needs SAML, Authelia and Dex are out. If everything is modern OIDC, they are back in.
- Can you run it? An identity provider is your most critical service. If you cannot staff patching, backups, and high availability, choose a managed option instead of self-hosting.
- What does the license allow? Apache 2.0 and MIT are permissive. AGPL-3.0, which Zitadel adopted in version 3, has network-use obligations that matter for commercial products.
Run a proof of concept with your two hardest apps before committing: one modern OIDC app and one legacy SAML app. If both connect cleanly and the admin experience feels manageable, you have your answer. If you need a broader starting point, our small business cybersecurity checklist covers identity alongside backups, updates, and device security.
What does it take to run your own SSO safely?
Running your own identity provider makes it your most critical service. If it goes down, nobody can log in anywhere. If it is compromised, every connected app is at risk. Budget for the operations, not just the install.
- High availability: run at least two instances behind a load balancer, with a replicated database.
- Backups: back up the database and configuration, and test restoring them. A backup you have never restored is a hope, not a plan.
- Patching: subscribe to the project's security announcements and patch quickly — identity software is a prime target.
- Admin MFA: require phishing-resistant multi-factor authentication for every admin account, and keep a break-glass account offline.
- TLS everywhere: serve the identity provider over HTTPS with a valid certificate, and check it with our free SSL checker.
- Monitoring: alert on failed logins, new admin accounts, and configuration changes.
If that list looks like more than your team can staff, that is useful information: a managed identity provider is the right answer, and there is nothing wrong with choosing it.
Free vs paid: what do you actually pay for?
Self-hosting every project in this list is free. The money goes to what surrounds it: servers, backups, your time, and optionally commercial support or a managed cloud. Authentik's enterprise edition adds features on top of the free core, and Zitadel's cloud charges above its free tier — read each project's pricing page before depending on a feature that turns out to be paid.
Compare that with commercial identity providers, where you pay per user per month for hosting, support, and integrations. For a small team, self-hosted Keycloak or authentik can save thousands a year. For a team with no identity expertise, the commercial price buys the operations you would otherwise have to staff yourself.
The bottom line
Keycloak is the best open source SSO solution for most teams: free, Apache 2.0 licensed, and the most widely deployed, with OIDC, SAML, and federation built in. Authentik is the easiest for self-hosted internal apps, Zitadel is the right choice for multi-tenant B2B products, and Authelia wins when you only need a login portal in front of a reverse proxy.
Whichever you choose, treat it as the front door to everything: patch it, back it up, require strong MFA for admins, and test your two hardest apps before you commit. The cheapest identity provider is the one you can actually run safely.
Frequently asked questions
What is the best open source SSO solution?
For most teams it is Keycloak, because it is the most widely deployed open source identity server, it is Apache 2.0 licensed, and it supports SAML 2.0, OpenID Connect, identity brokering, and user federation with LDAP and Active Directory. If you need multi-tenant B2B identity, Zitadel is the stronger fit; for a homelab, authentik is easier.
What is SSO and how does it work?
Single sign-on lets a user sign in once with an identity provider and then access multiple applications without signing in again. The identity provider checks the user's credentials, then issues a token or assertion that each application trusts, using a standard protocol such as OpenID Connect or SAML 2.0.
Is Keycloak really free?
Yes. Keycloak is open source under the Apache 2.0 license and free to self-host. Red Hat sells commercial support through the Red Hat build of Keycloak, but the community project itself costs nothing to run.
What is the difference between OIDC and SAML?
Both are standards for single sign-on. OpenID Connect is built on OAuth 2.0, uses JSON tokens, and is the modern default for web and mobile apps. SAML 2.0 uses XML assertions and is still common in enterprises, universities, and older applications. Most open source identity providers support both.
Can open source SSO replace Okta or Entra ID?
For many teams, yes. Keycloak, authentik, and Zitadel cover the core job: one login for many apps, MFA, and federation with other providers. What you give up is the vendor's hosted uptime, support, and pre-built integrations, and you take on running a critical service yourself.
Is self-hosted SSO secure?
It can be, but the identity provider becomes your most sensitive system: if it is compromised, every connected app is at risk. Keep it patched, put it behind TLS, back up its database, enable MFA for admins, and monitor it. If you cannot staff that, a managed identity provider is the safer answer.
What license is Zitadel under?
Zitadel moved to the AGPL-3.0 license with version 3 in 2025, with some directories under Apache 2.0 or MIT. The AGPL requires you to offer the source code to users who interact with the software over a network, so read the license before building a commercial product on it.
What is the lightest open source SSO option?
Authelia is the lightest choice in this list. It is a small Go binary that sits in front of a reverse proxy and adds login and two-factor authentication to applications that have no login of their own, without running a full identity platform.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against the official project sites for Keycloak, authentik, ZITADEL, Authelia, Ory, and Apereo CAS, and protocol and license details published by those projects.
How we write and fact-check →