Migrating from Azure AD B2C before the Entra deadline
Microsoft has drawn a line under Azure AD B2C. New B2C tenants are no longer being created for new customers, the product is steered toward Microsoft Entra External ID, and the writing on the wall is clear enough that waiting for a forced end-of-life date is the wrong plan. If you are going to re-platform your customer identity anyway, the question is not whether to move but where to — and this is the rare migration where the deprecation clock does your business case for you.
What "deprecation path" actually costs you
B2C's deepest hook is not the user store; it is the custom policies. If your team built anything beyond the stock user flows — custom claims transformations, external REST API calls during sign-in, bespoke MFA logic — that logic lives in the Identity Experience Framework as a sprawl of XML TrustFrameworkPolicy files. None of it ports anywhere. It is written against B2C's internal schema and claims pipeline, and moving means reimplementing the intent of each policy on the target platform, not copying files.
Before you plan anything, audit how many custom policies you run and what each one does. Teams that only ever used the built-in user flows have an easy migration. Teams with a mature Identity Experience Framework deployment should scope the policy reimplementation as the largest single line item in the project — it dwarfs the user export.
Exporting users with Microsoft Graph
B2C user data comes out through the Microsoft Graph API. You enumerate users and expand the identities collection to capture the local-account sign-in names and any social identities. A paged pull looks like this:
curl -s \
-H "Authorization: Bearer $GRAPH_TOKEN" \
"https://graph.microsoft.com/v1.0/users?\
$select=id,displayName,identities,otherMails,\
accountEnabled&$top=999" \
> b2c_users_page1.json
# Follow @odata.nextLink until it is absent to page through all users.Expand identities so you capture the signInType (emailAddress, userName, or a federated issuer) for each account. Custom attributes defined in B2C surface as extension properties with a long extension_<appId>_name prefix; map those to real columns in your target schema as part of the transform.
Password hashes, again, do not come out
As with every managed identity provider, B2C will not export password hashes. Local-account credentials stay inside Microsoft's directory. So the same two strategies apply: a forced reset at cutover, or a rehash-on-login bridge where the first authentication is delegated to B2C via its OIDC endpoint and the verified password is captured and rehashed locally.
-- Target schema keeps a bridge column until the user migrates.
CREATE TABLE users (
id UUID PRIMARY KEY,
email CITEXT UNIQUE NOT NULL,
password_hash TEXT, -- NULL until first local login
b2c_object_id UUID, -- source of truth during bridge
mfa_enrolled BOOLEAN DEFAULT false,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
-- On first successful delegated login, fill password_hash
-- and clear b2c_object_id to cut the account loose.Re-homing your OIDC applications
Every app that trusts B2C does so as an OIDC relying party pointed at a B2C user-flow authority URL. Re-homing each one means swapping the authority/issuer to your new platform, issuing fresh client IDs and secrets, and re-registering redirect URIs. The mechanical steps per app:
- Register the application on the new platform and record its client credentials.
- Re-map claims. B2C emits some claims with B2C-specific names (
emailsas an array,tfpfor the policy); align these to standard OIDC claims your app can consume. - Carry over redirect URIs and post-logout redirect URIs exactly.
Rebuild custom policy logic as features, not XML
This is where the migration earns its keep. Each custom policy was solving a real requirement, and a modern platform usually expresses that requirement as configuration or a webhook rather than hand-written claims-pipeline XML:
- A REST
TechnicalProfilethat called your API mid-sign-in becomes a pre- or post-authentication hook. - Claims transformations become attribute-mapping rules.
- Age-gating, consent collection, or conditional MFA become policy toggles on the new platform.
Write down the requirement behind each policy before you touch the new system, so you are migrating business rules, not transliterating Microsoft's framework.
MFA and social identities do not travel
Two more things stay behind with the hashes. B2C's MFA enrollments — which users registered authenticator apps or phone numbers — are not something you lift and shift; users re-enroll their second factor on the new platform, typically at first login after cutover. Plan the in-flow prompt and the support messaging for that, because it is the one moment of friction users will actually notice. Social identities are easier but need care: an account whose signInType is a federated issuer (Google, Facebook, an enterprise IdP) has no local password at all, so re-home those as OAuth/OIDC connections on the new platform and match users by verified email so the same person lands on the same account.
Cut over per application, validate on the public host
Run B2C and the new platform side by side. Migrate one OIDC app at a time, starting with a low-risk internal one, and validate the full round trip — sign-in, token issuance, claims, sign-out — against the real public endpoint, not just a local test. Keep the B2C tenant live as the rehash-on-login source until the active population has crossed, then run the final reset sweep for dormant accounts and retire the tenant.
The deprecation of B2C is an unwelcome push, but it is also permission to stop renting your customer identity from a platform whose roadmap you do not control. Re-homing onto something you host yourself means the next product-strategy decision at your identity vendor is never again your emergency. Bastionary runs on your own infrastructure with OIDC, SAML, and hook-based custom logic, so the policies you rebuild during this migration are the last ones you rebuild under someone else's deadline.
Run it yourself
Bastionary is free, open-source software. Follow the quick start to have it running on your own server, or browse the releases on Git.