Keycloak vs Microsoft Entra ID: The Self-Hosted Case

Guilliano Molaire Guilliano Molaire Updated October 15, 2026 10 min read

Microsoft Entra ID (formerly Azure AD) is a fully-managed cloud identity platform tightly integrated with Microsoft 365 and Azure, licensed on a per-user subscription model. Keycloak is an open-source, self-hostable identity provider you run on your own infrastructure, or hand off to a managed host, with no per-user fee. Choose Entra ID if you run a Microsoft-first organization and want zero infrastructure operations; choose Keycloak for open-source freedom, multi-cloud and on-premises flexibility, full protocol control, and a cost model that does not scale with headcount. Managed Keycloak hosting, such as Skycloak, adds the operations layer so you get both.

What each product actually is

Microsoft Entra ID is Microsoft’s cloud identity platform. It handles workforce single sign-on, multi-factor authentication, Conditional Access policies, and device management for organizations already invested in Microsoft 365, Azure, and the broader Microsoft ecosystem. Entra ID is entirely cloud-hosted and managed by Microsoft, there is no self-hosted option.

Keycloak is an open-source identity and access management server maintained by Red Hat and the broader community. Version 26.x runs on a Quarkus-based runtime, supports OpenID Connect, OAuth 2.0, SAML 2.0, and LDAP/Kerberos federation out of the box, and is deployable anywhere: bare metal, VMs, Kubernetes, or private cloud. Every protocol, flow, and data store is yours to configure and extend.

These two products serve overlapping use cases, workforce SSO being the most common, but they come from fundamentally different philosophical positions on control, cost, and ecosystem lock-in.

Side-by-side comparison tables

Licensing and cost model

Keycloak Microsoft Entra ID
License Apache 2.0 (open source) Commercial SaaS subscription
Cost model No per-user fee; pay for infrastructure Per-user/per-month subscription
Free tier Full feature set, unlimited users Entra ID Free (basic SSO + MFA)
Advanced features All features included P1 / P2 tiers unlock Conditional Access, PIM, Identity Protection
Vendor dependency None Microsoft account required

Hosting and operations

Keycloak Microsoft Entra ID
Hosting model Self-hosted or managed (e.g., Skycloak) Microsoft-managed cloud only
On-premises deployment Yes No
Multi-cloud deployment Yes (any cloud or hybrid) Azure-native; can federate others
Uptime responsibility You (or your managed host) Microsoft SLA (99.99%)
Upgrade cadence You control Microsoft-managed automatic

Protocol and standards support

Keycloak Microsoft Entra ID
OpenID Connect Full Full
OAuth 2.0 Full (all grant types) Full
SAML 2.0 Full (SP + IdP) Full (limited IdP-initiated flows)
LDAP / Active Directory Native federation Native (AD sync via Entra Connect)
SCIM provisioning Native inbound API from 26.8; extensions for outbound Built-in (Entra provisioning)
WS-Federation No Yes (legacy Microsoft apps)
Custom authentication SPIs Yes, full Java SPI No

Ecosystem integration

Keycloak Microsoft Entra ID
Microsoft 365 / Teams / SharePoint Via federation or SAML Native, seamless
Azure services Configurable Native, first-class
Non-Microsoft SaaS apps Protocol-based (OIDC/SAML) App gallery (7,000+ pre-built connectors)
AWS / GCP federation Yes Yes (with extra configuration)
Developer SDKs Community (various languages) MSAL (Microsoft-maintained)
Legacy app support LDAP, Kerberos, SAML AD Connect, ADFS bridge

Access policies and security

Keycloak Microsoft Entra ID
Conditional access / adaptive auth Via custom SPIs or third-party Built-in Conditional Access (P1+)
Risk-based sign-in policies Custom scripting / extensions Entra ID Protection (P2)
Privileged Identity Management Not built-in Built-in PIM (P2)
MFA methods TOTP, WebAuthn, email, custom flows Authenticator app, FIDO2, SMS, voice
Passwordless WebAuthn via Keycloak 26 Passkeys, Windows Hello, FIDO2
Session management Fine-grained per-realm / per-client Policy-based, less granular

Customization and extensibility

Keycloak Microsoft Entra ID
Login page branding Full HTML/CSS/Freemarker templates Entra ID P1+ company branding
Custom authentication flows Yes, drag-and-drop flow builder Conditional Access rules only
Custom user attributes Yes, unlimited Yes, directory extension attributes
Custom protocol mappers Yes, Java SPI Limited
Custom REST APIs Admin REST API (full) Microsoft Graph (broad, read-heavy)
Theme / UI customization Complete control Limited to approved templates

Data control and residency

Keycloak Microsoft Entra ID
Data residency You choose (run anywhere) Microsoft data centers; region selection available
Export user data Full database access Microsoft Graph export; some limitations
Audit log ownership Full (forward to any SIEM) Entra logs; export to Azure Monitor / SIEM
Vendor lock-in None, standard protocols Microsoft ecosystem dependency

Deep dive: where Entra ID genuinely wins

Microsoft 365 and Azure integration

If your organization uses Microsoft 365, Entra ID is not just convenient, it is the identity backbone. Users get SSO across Outlook, Teams, SharePoint, Azure portal, Intune, and thousands of Microsoft-first applications without a single line of custom configuration. Keycloak can federate with Microsoft 365 via SAML, but you are always adding an indirection layer. For pure Microsoft shops, that indirection rarely pays off.

Conditional Access policies

Entra ID P1’s Conditional Access engine is a mature, battle-tested policy framework. You can enforce MFA based on user risk score, device compliance state, sign-in location, application sensitivity, and dozens of other signals, all through a policy UI without writing code. Keycloak can approximate this with custom Authentication SPIs in version 26.x, but it requires development effort and ongoing maintenance.

Compliance certifications and managed scale

Microsoft maintains Entra ID’s compliance posture across dozens of frameworks (SOC 2, ISO 27001, FedRAMP, HIPAA BAA, and more) and absorbs any scale event transparently. For teams that need to show auditors a vendor certification document rather than manage their own compliance program, this is a significant operational advantage.

Entra ID’s app gallery contains pre-built connectors for thousands of SaaS applications with automated user provisioning. If you need to provision users into Salesforce, Workday, ServiceNow, and GitHub simultaneously, Entra ID does it with point-and-click configuration. Keycloak’s native SCIM support is growing but still requires more manual configuration for each downstream application.

Deep dive: where Keycloak wins

No per-user licensing at any scale

Keycloak’s Apache 2.0 license means the software itself is free regardless of how many users you have. Your costs are infrastructure and, if you choose not to self-manage, a managed hosting fee. For applications with tens of thousands of users, the difference between a flat infrastructure cost and a per-user SaaS fee compounds quickly. The true cost comparison of self-hosted vs managed authentication illustrates this at several user scales.

Multi-cloud and on-premises deployment

Keycloak runs wherever you run containers, AWS EKS, Google GKE, Azure AKS, on-premises Kubernetes, or bare metal. This matters for organizations with data residency requirements that cannot be satisfied by Microsoft’s regional data center selection, air-gapped government deployments, or hybrid architectures where the identity provider must live on-premises. Entra ID offers no on-premises deployment path.

Full protocol control and extensibility

Keycloak 26.x implements OpenID Connect and SAML 2.0 as first-class citizens, including advanced OIDC features like DPOP, pushed authorization requests (PAR), and rich authorization policy integration via fine-grained authorization. The Service Provider Interface (SPI) system lets you write Java plugins that extend authentication flows, event listeners, user storage, and protocol mappers. This level of extensibility is structurally unavailable in a managed SaaS platform.

Data sovereignty and audit log ownership

With Keycloak, the user directory and audit logs live on infrastructure you control. You can forward events to any SIEM using native event listeners or Skycloak’s HTTP webhook integration, retain them as long as your compliance program requires, and query them directly against your database. Entra ID audit logs flow through Azure Monitor and carry Microsoft’s retention and export limitations. For sectors with strict data sovereignty rules, healthcare, defense, financial services, this distinction is often decisive.

Avoid Microsoft ecosystem lock-in

An organization that standardizes on Entra ID as its sole identity layer becomes dependent on Microsoft’s pricing decisions, feature roadmap, and availability. Keycloak uses standard protocols throughout. If you need to federate Keycloak with a downstream application today and replace Keycloak with a different IdP in five years, your applications only need to re-point their OIDC or SAML configuration, no proprietary SDK changes required. The SSO implementation guide for developers covers how to build applications against standard protocols from the start.

Workforce SSO: the most common comparison point

The most frequent scenario where teams compare these two products is workforce SSO: giving employees one login for all internal and SaaS applications.

For a Microsoft-first workforce, Entra ID is likely already in place and providing this. Adding Keycloak would be an additional layer, useful only if you need protocol support Entra ID lacks, have applications that require an on-premises IdP, or want to consolidate identity across Microsoft and non-Microsoft environments under a single, vendor-neutral IdP.

For organizations not already in the Microsoft ecosystem, Keycloak provides the same core SSO capability, OIDC, SAML, LDAP federation, MFA, without the per-user licensing cost or cloud-only constraint. When configured against an LDAP directory or an existing identity store, Keycloak can serve as the SSO hub for the entire organization.

You can also run both in parallel. A common architecture federates Entra ID into Keycloak as an upstream identity provider using SAML, so Microsoft-authenticated users can access Keycloak-protected applications without a separate account. This gives you the Entra ID UX for Microsoft apps and Keycloak’s protocol flexibility for everything else.

A note on Azure AD B2C and Entra External ID

Azure AD B2C (business-to-consumer identity) is Microsoft’s customer-facing identity platform. It is architecturally separate from Entra ID (workforce identity) and is currently being migrated toward its successor product, Entra External ID. If you are evaluating Microsoft’s customer identity offering, social login, self-service registration, branded login pages for end users, that is a different comparison than Entra ID for workforce SSO.

Keycloak serves both workforce and customer-facing scenarios from a single product. For teams currently on Azure AD B2C considering alternatives, the migration guide from Azure AD B2C to Keycloak covers the full transition path.

When to choose managed Keycloak instead of self-hosting

Self-hosting Keycloak means you own the upgrade schedule, high-availability configuration, TLS certificates, database backups, and incident response. For teams without dedicated infrastructure engineering, that operational surface is real overhead.

Managed Keycloak hosting, like Skycloak, eliminates those ops concerns while preserving every benefit of the Keycloak product: open-source codebase, no per-user fee, full protocol support, and complete data residency control. You get a dedicated Keycloak instance on infrastructure you specify, with SLA-backed uptime and automatic upgrades to current Keycloak versions. It is a practical middle path between the DIY operational burden and the constraints of a managed SaaS identity platform.

For a head-to-head cost model comparing self-managed Keycloak, managed Keycloak hosting, and commercial SaaS alternatives, the Keycloak vs Okta comparison works through the numbers in detail.

Summary

Entra ID is the right answer if you run a Microsoft 365 organization, want Microsoft to manage identity operations completely, and are willing to license on a per-user basis. Its Conditional Access engine, SCIM provisioning, and app gallery are genuinely mature.

Keycloak is the right answer if you need on-premises or multi-cloud deployment, want no per-user licensing fee, need deep protocol customization, or require data sovereignty that a single cloud vendor cannot guarantee. Version 26.x is production-stable, actively maintained, and covers every protocol a modern identity deployment requires. Managed hosting removes the last major operational objection.

These are not always competing choices. Many organizations run Entra ID for Microsoft workloads and Keycloak for everything else, connected via SAML federation.

Frequently asked questions

Is Keycloak an alternative to Microsoft Entra ID?

Yes, for workforce SSO and identity federation use cases, Keycloak is a direct alternative. Both support OIDC, SAML 2.0, MFA, and user federation. The practical differences are deployment model (cloud-only for Entra ID vs anywhere for Keycloak), licensing (per-user subscription for Entra ID vs open-source for Keycloak), and ecosystem integration depth (Entra ID has native Microsoft 365 integration that Keycloak achieves only through federation). For non-Microsoft environments, Keycloak often provides equivalent functionality without the per-user cost.

Is Entra ID the same as Azure AD?

Entra ID is the current name for what was previously called Azure Active Directory (Azure AD). Microsoft rebranded the product to Microsoft Entra ID in 2023 as part of a broader rebranding of its identity and security portfolio under the Entra family. The underlying service, features, and licensing tiers (Free, P1, P2) remained largely the same. You will still encounter “Azure AD” in older documentation, APIs, and tooling, it refers to the same product.

Does Keycloak integrate with Microsoft 365?

Keycloak can federate with Microsoft 365 but it requires configuration on both sides. The most common pattern is configuring Entra ID as an upstream identity provider inside Keycloak, so users authenticate with their Microsoft credentials and Keycloak issues tokens for your downstream applications. The reverse direction, using Keycloak as the primary IdP for Microsoft 365, is technically possible via SAML federation but is uncommon and complex. The step-by-step configuration for connecting the two via SAML is covered in the guide on configuring Entra ID as a SAML identity provider in Keycloak.

Can Keycloak replace Entra ID for a Microsoft-first organization?

Partially. Keycloak cannot natively manage Microsoft 365 licenses, device compliance policies through Intune, or Azure RBAC, those are deeply coupled to Microsoft’s cloud services. It can replace Entra ID for application SSO, token issuance, and non-Microsoft user federation. For organizations already standardized on Microsoft 365, the more practical architecture is federation rather than replacement: Entra ID handles Microsoft workloads, Keycloak handles everything else, and SAML or OIDC connects them.

What happens to Azure AD B2C?

Azure AD B2C is Microsoft’s customer-facing identity platform, separate from Entra ID (which is workforce-focused). Microsoft is migrating B2C capabilities to Entra External ID, its next-generation customer identity product. If you are currently on Azure AD B2C and evaluating a migration path, Keycloak is a frequently considered alternative, it handles customer-facing identity (social login, self-service registration, branded flows) alongside workforce identity from a single instance. The full migration path is documented in the Azure AD B2C to Keycloak migration guide.


Ready to run Keycloak without managing the infrastructure yourself? See Skycloak’s managed Keycloak plans and get a dedicated instance with SLA-backed uptime, automatic upgrades, and no per-user licensing.

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

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.

Start Free Trial Talk to Sales
© 2026 Skycloak. All Rights Reserved. Design by Yasser Soliman