Skip to content
Migration

Replace Azure AD B2C with Keycloak, on your own timeline

Microsoft stopped selling Azure AD B2C to new customers and points them to Microsoft Entra External ID. If you would rather leave Microsoft’s customer identity products, here is how B2C’s pieces map to an open-source realm, and what does not carry over.

Point here to play
A simplified drawing of a planned move. Microsoft’s status is quoted from its own pages, listed under Sources.
The short answer

Microsoft ended sales of Azure AD B2C to new customers on May 1, 2025. Existing customers can keep using it, and Microsoft says it will support B2C until at least May 2030, so there is time to move with care. In Keycloak, a B2C tenant becomes a realm, user flows become authentication flows and required actions, and social and company identity providers become brokered identity providers. Plan for two things: B2C does not export password hashes, so people set a password again, and each user’s ID changes, so your app maps old IDs to new ones.

How it works

Built from Keycloak’s own parts

Realms, clients, authentication flows and mappers, as the standard admin console has them. Nothing here needs a custom extension.

Where Azure AD B2C stands

From Microsoft’s own pages, read on 25 November 2026:

  • Effective May 1, 2025, Azure AD B2C is no longer available to purchase for new customers. Current customers can continue using it.
  • Microsoft says it will continue supporting Azure AD B2C until at least May 2030, with SLAs, security updates and compliance unchanged.
  • New B2C tenants can only be created with the P1 tier. The P2 tier was discontinued on March 15, 2026, for all customers.
  • Microsoft’s next-generation product for customer and partner identities is Microsoft Entra External ID.

So nothing forces you to leave tomorrow. The choice is whether to move to Entra External ID, staying with Microsoft, or to a standards-based server you can run anywhere. The links are under Sources below.

How B2C maps to a realm

Azure AD B2CIn Keycloak
B2C tenantA realm
App registrationA client (OpenID Connect or SAML)
User flow: sign up and sign inThe browser flow, with user registration on
User flow: password reset, profile editForgot password, and the account console
Local accountsUsers with passwords in the realm
Social and enterprise identity providersBrokered identity providers
Custom attributes (extension_…)User profile attributes
Custom domain (instead of b2clogin.com)Your own domain, such as auth.yourcompany.com
Multifactor authenticationOne-time codes, passkeys, recovery codes

Custom policies built on the Identity Experience Framework have no direct import. Their steps are rebuilt as authentication flows, conditions and required actions. Steps that call your own REST API during sign-in need a custom authenticator, which is an extension, and our tenant images do not support extensions yet. List those steps early; each needs another answer, often in your app after sign-in.

Users, passwords and IDs

Export users through Microsoft Graph: object ID, email addresses, names, sign-in names and your custom attributes. Import them into the realm, keeping the B2C object ID as an attribute such as legacy_b2c_id.

Passwords do not move: B2C does not export password hashes. The usual path is to mark each imported user with the Update Password required action, so they choose a password at their first sign-in after a reset email, or to let them sign in with a passkey or a social provider instead. A just-in-time migration that checks old passwords against B2C at first sign-in needs a custom extension, which we cannot run today.

Each user gets a new sub in Keycloak. If your database is keyed on B2C object IDs, map the kept attribute into tokens with a user attribute mapper, and switch your records over at your pace.

Moving the apps

  1. Create the realm, its clients and identity providers, and import the users into a staging copy.
  2. Register new redirect URIs at Google, Microsoft and the other providers you broker; they now point at your realm.
  3. Point each app at the new issuer, https://auth.yourcompany.com/realms/customers. Apps that use MSAL usually move to a standard OpenID Connect library.
  4. Test sign-up, sign-in, reset and every social provider on staging.
  5. Switch over, send password reset emails, and keep B2C running until the last app has moved.

We migrate from Azure AD B2C. Moving from Azure AD B2C describes what moves, what happens to passwords and how the move is tested.

Who does what

We run the server. You shape the realm.

RealmDeploy runs
  • A realm for your customers on a cluster of your own, on your domain
  • Help with the user import and a staging copy to test on
  • Outbound network rules to the social and company providers you broker
  • Backups with point-in-time restore, from the first import on
  • Upgrades, monitoring and on-call afterwards
You configure, in the admin console
  • The Microsoft Graph export of your users
  • Rebuilding custom policy steps as flows and required actions
  • New app registrations at your social providers
  • App changes: issuer, library, and the mapping of old user IDs
  • Telling your users about the password reset
Which plan

Usually Premium

The plans are sized by realms and by active users a month: people who sign in at least once in the month. These are sizing guides, not hard caps.

Starter$199 a month
  • Dedicated Keycloak, 1 replica
  • Up to 2 realms
  • Sized for about 5,000 active users a month
  • Best effort, no uptime SLA
Fits this jobPremium$999 a month
  • High-availability cluster, 2+ replicas
  • Up to 20 realms
  • Sized for about 100,000 active users a month
  • 99.9% monthly uptime SLA
Enterprise$2,499 a month
  • Larger high-availability cluster
  • Up to 100 realms
  • Sized for about 500,000 active users a month
  • 99.95% monthly uptime SLA

Size by the people who sign in each month, the same way B2C counts monthly active users. Premium is sized for about 100,000 active users with two or more replicas and a 99.9% SLA, and its 10 service hours a month can go to the migration. Starter fits a small app with about 5,000 active users. Enterprise is sized for about 500,000 with a 99.95% SLA; larger B2C tenants get a Custom plan through the contact form.

Every plan, feature by feature

Sources

Where the outside facts come from

Read on the date at the top of the explanation. If one of these has changed, tell us through the contact form and we will correct this page.

  1. Microsoft Learn: What is Azure Active Directory B2C?
  2. Microsoft Learn: Azure AD B2C FAQ, end of sale
  3. Microsoft Learn: Introduction to Microsoft Entra External ID
Questions

Frequently asked questions

Do I have to leave Azure AD B2C now?

No. Microsoft says existing customers can keep using it and that it will support B2C until at least May 2030. What ended on May 1, 2025, is new purchases.

Why not move to Microsoft Entra External ID?

It is Microsoft’s successor and a fair choice if you want to stay with Microsoft. Choose a realm if you want open-source Keycloak and standard protocols, on a cluster of your own, at a flat monthly price sized by active users.

Can my users keep their passwords?

No. B2C does not export password hashes, so people set a new password once, after a reset email, or sign in with a passkey or a social provider instead.

Will user IDs change?

Yes. Keycloak gives each user its own ID. Keep the B2C object ID as a user attribute, add it to tokens with a mapper, and move your records over at your pace.

Do custom policies carry over?

Not as files. Their steps are rebuilt as authentication flows, conditions and required actions. Steps that call your own REST API during sign-in need an extension, which tenant images do not support yet.

Do social logins keep working?

Yes, after you register the new redirect URIs at each provider. On their first social sign-in, the first broker login flow links people to their imported account once they confirm it by email.

Can I keep my own sign-in domain?

Yes. Your realm runs on your own domain with HTTPS, so you can keep a custom domain like the one you set up in B2C.

Run it on a cluster of your own

Order a realm in the dashboard, or write to us first about what you are building.