Leaving IdentityServer for Microsoft Entra External ID: What You Lose, How Users and Passwords Move, and What It Costs
Moving from IdentityServer to Microsoft Entra External ID: which features have no equivalent, how users and password hashes migrate, and what it costs.
If you run IdentityServer4 or Duende IdentityServer, the managed option most teams look at is Microsoft Entra External ID: Microsoft’s customer identity service, and the product Microsoft now points everyone to since Azure AD B2C stopped being sold to new customers on 1 May 2025 (existing B2C tenants are supported “until at least May 2030”).
Almost every Entra migration guide assumes you are leaving B2C. This one assumes you are leaving a token server you host yourself. We haven’t run this migration for a client, so everything below comes from Microsoft’s documentation as of November 2026, with a link on every claim. Treat it as a decision guide and a map of the work, not a war story.
The short version
| Question | Answer |
|---|---|
| Can Entra External ID replace a typical IdentityServer setup? | Yes for interactive sign-in with OpenID Connect, OAuth 2.0 and SAML apps. No for anything that depends on custom grant types, the password grant, or server-side extensibility you wrote yourself. |
| Can you keep your users’ passwords? | Yes, without forcing a reset, through just-in-time migration: Entra calls your code at a user’s first sign-in, your code checks the old hash, and Entra stores the password. |
| Can you keep issued tokens and sessions? | No. Entra signs with its own keys, so every client gets new tokens and every user signs in once more. |
| What does it cost? | The core offer is free up to 50,000 monthly active users. Above that you pay per monthly active user, and machine-to-machine calls are billed separately per transaction. |
What maps, and what doesn’t
The table below maps the IdentityServer concepts that usually matter in a migration onto Entra External ID. “Not supported” means we found no equivalent in Microsoft’s documentation for external tenants.
| IdentityServer | Entra External ID | Notes |
|---|---|---|
| Clients | App registrations | OIDC and OAuth apps are app registrations, always single-tenant in an external tenant. SAML apps are registered as enterprise applications instead. |
| API scopes and API resources | “Expose an API” scopes on the API’s app registration | Client apps can request your API’s delegated scopes plus openid, offline_access and Graph User.Read, and only an admin can consent on behalf of the organization. |
IProfileService (claims at token time) | Claims mapping plus a custom claims provider | A custom authentication extension on the TokenIssuanceStart event calls your REST API to add claims from external systems. It is an HTTP callout, not in-process code. |
| Claims on client-credentials tokens | Not supported through the claims provider | An accepted Microsoft Q&A answer states that token issuance extensions apply only to interactive flows, not client credentials. If your APIs rely on custom claims in machine tokens, plan to move that logic into the API or use app roles. |
| Extension grants (custom grant types) | Not supported | External tenants support authorization code (with PKCE), client credentials, device authorization, on-behalf-of and implicit flows. Custom grant types aren’t on the list. Token exchange built as an IdentityServer extension grant needs redesigning. |
| Resource owner password (ROPC) | Not supported | ROPC is “No” in external tenants. Microsoft’s suggested replacement for mobile apps is native authentication. |
| Reference tokens and introspection | Not supported | Entra issues JWT access tokens that your API validates locally against the published signing keys. We found no reference-token or introspection option, so any API that calls your token server’s introspection endpoint changes to local JWT validation. |
| Acting as a SAML identity provider | Supported | External tenants list “SAML relying parties” among supported protocols, registered as enterprise apps. |
| Signing keys | Managed by Microsoft | Entra signs with its own keys and rotates them periodically. You can’t import the key IdentityServer signs with, so old and new tokens aren’t interchangeable. |
| Persisted grants (refresh tokens, consents) | No import path | Nothing in Microsoft’s migration guidance imports another server’s grants. Users sign in once against Entra, and that sign-in is also when their password migrates. |
| Custom UI and server-side login code | User flows, branding, native authentication | Entra has no custom policies; Microsoft describes the platform as designed to cover equivalent cases without them. If you need full UI control, native authentication lets you build the sign-in screens in your app, including social sign-in, which still opens a browser window for the provider step. |
The pattern is clear. Entra is a good fit if your IdentityServer is a fairly standard OIDC provider with an ASP.NET Core Identity user store. It gets harder the more you have customised IdentityServer itself: extension grants, reference tokens, profile services with complex logic, or the password grant. Those features are often why teams chose a self-hosted server in the first place, so count them before anything else.
Migrating users and passwords
Microsoft’s migration guide has four stages: migrate user data, prepare for credential migration (a migration flag on every account), migrate credentials, then validate and cut over. It applies to any legacy identity provider, including a self-hosted IdentityServer with an ASP.NET Core Identity database.
Stages 1 and 2: create users with a migration flag through Microsoft Graph
- Clean up first. Microsoft recommends migrating only the attributes you need, removing stale accounts, and resolving duplicate usernames before you start, because usernames must be unique.
- Define a Boolean directory extension property, for example
toBeMigrated, on the tenant’sb2c-extensions-app(the name is a carry-over from B2C). - Create each user through
POST /usersin Microsoft Graph withcreationType: "LocalAccount", a unique, strong random password, andtoBeMigrated: true.
Entra can’t import a password hash. If you have plaintext passwords you can set them directly, but an ASP.NET Core Identity database stores PBKDF2 hashes, so you won’t. The random password is a placeholder until the user’s first sign-in. Microsoft also warns about Graph throttling on large imports, so batch the job and retry on 429 responses.
Stage 3: just-in-time password migration
Just-in-time migration uses a custom authentication extension on the OnPasswordSubmit event. The flow:
- A user signs in to Entra with their old password. It doesn’t match the random placeholder.
- Because the user’s
toBeMigratedflag istrue, Entra calls your HTTPS endpoint, typically an Azure Function. - The request carries an
encryptedPasswordContext: a JWE encrypted with a certificate whose public key sits in the app registration and whose private key stays in Azure Key Vault. Decrypted, it containsuser-password,usernameand anonceyou must echo back. - Your code returns one of four actions:
MigratePassword(correct; Entra stores the password and clears the flag),UpdatePassword(correct but weak; the user goes through a reset),Retry(wrong password) orBlock.
After that, the user signs in directly against Entra and your endpoint is never called for them again. Microsoft’s page is explicit that this is password migration, not ongoing delegation to your old system.
Checking an ASP.NET Core Identity hash. The docs leave how you validate the password up to you. For an IdentityServer backed by ASP.NET Core Identity, the simplest validation reads the user’s PasswordHash from your existing AspNetUsers table and calls PasswordHasher<TUser>.VerifyHashedPassword. The V3 hash format stores its own PRF, iteration count and salt in the hash header (source). So the current hasher verifies hashes written years ago with HMAC-SHA256 and 10,000 iterations, even though today’s default is HMAC-SHA512 with 100,000 iterations. Success and SuccessRehashNeeded both mean the password is correct; map them to MigratePassword, and map Failed to Retry.
var hasher = new PasswordHasher<LegacyUser>();
var result = hasher.VerifyHashedPassword(legacyUser, legacyUser.PasswordHash, password);
return result switch
{
PasswordVerificationResult.Success or PasswordVerificationResult.SuccessRehashNeeded
=> ResponseActionType.MigratePassword,
_ => ResponseActionType.Retry,
};
Microsoft’s guide covers the rest: Key Vault setup, nonce handling, and the disableStrongPassword option for users whose old passwords don’t meet Entra’s complexity rules. Two things to plan for:
- Read-only access to the old database for the whole migration window. Every user who hasn’t signed in since cutover still needs their legacy hash. Dormant users who never come back stay on the random placeholder and will need self-service password reset.
- Rate limiting on your endpoint. Microsoft’s guidance on the related credential-harvesting approach warns that a validation API is a brute-force target. Apply the same lockout rules you have today.
If losing passwords is acceptable, for example because most users sign in with Google or Apple, or you’re moving to passkeys or email one-time codes, Microsoft lists skipping credential migration and relying on password reset as valid options.
Cutting over the apps
Because tokens aren’t interchangeable, the order matters more than in an IdentityServer to Duende move:
- APIs first. Configure each API to accept tokens from both issuers during the transition: the old IdentityServer authority and the Entra authority at
https://<tenant>.ciamlogin.com/. Switch any introspection calls to JWT validation. - Machine clients. Re-register service clients as Entra app registrations with new secrets or certificates, move their scope requests over, and confirm that nothing reads custom claims from client-credentials tokens.
- Interactive apps. Point each app at the Entra authority. On first sign-in, each user’s password migrates. Existing refresh tokens from IdentityServer stop working, so expect a one-time sign-in for everyone.
- Decommission IdentityServer only after the migration window, and keep the user database read-only for password validation until then.
What it costs
Entra’s core offer is free for the first 50,000 monthly active users, counted across all tenants linked to the same subscription. Above that, you pay per monthly active user at the rate on Microsoft’s pricing page. Check it live before you budget; Microsoft has changed it before.
Two line items surprise IdentityServer teams:
- Machine-to-machine calls are billed per transaction. The M2M Authentication add-on charges for each client-credentials token request. Microsoft’s own example is a background service refreshing hourly, which works out to roughly 720 transactions a month. Self-hosted IdentityServer never billed for these.
- Add-ons have no free tier. SMS verification and Go-Local data residency (currently Australia and Japan only) are charged from the first use.
The comparison to make is MAU-based pricing against Duende’s licence tiers, which price by connected apps and features, not users. Our Duende IdentityServer pricing breakdown has the current tiers. As a rule of thumb, Entra is cheapest for apps with many clients and modest user counts, and gets more expensive as monthly active users and machine traffic grow. Duende is the reverse. Don’t forget to price your own time running IdentityServer: hosting, patching and key management are free on Entra and not free anywhere else.
When Entra External ID is the right call
Choose Entra if:
- your IdentityServer is a mostly standard OIDC provider over ASP.NET Core Identity
- you don’t use extension grants, reference tokens or the password grant, or can redesign around them
- you want to stop running a token server altogether
- you’re already on Azure, so the subscription and billing are in place
Stay self-hosted, on Duende or OpenIddict, if:
- custom grants, reference tokens or complex profile-service logic are part of how your platform works
- you need to sign with your own keys or keep existing tokens valid through cutover
- machine-to-machine traffic is high enough that per-transaction billing outweighs a licence
The full option set, including Keycloak and other managed providers, is in our comparison of Duende IdentityServer alternatives.
Where we can help
Whichever way you go, the hard part is the inventory: which clients use which flows, where custom claims come from, and which APIs introspect tokens. That inventory decides whether Entra fits. If you’d like a second opinion on yours, our IdentityServer consulting starts with a free 45-minute call.
Related Posts
IdentityServer4 → Duende: What Actually Breaks (We Migrated the Quickstart and Logged It)
We migrated the public IdentityServer4 EF quickstart to Duende IdentityServer 8 on .NET 10 and logged every failure. Licensing, keys, grants, rollback.
OpenIddict vs Duende IdentityServer: Mapping an IdentityServer4 Migration to OpenIddict
Moving IdentityServer4 to OpenIddict instead of Duende: how clients, scopes, grants and signing keys map, what you write yourself, and when it pays off.
Duende IdentityServer Pricing (2026): Editions, the Free Community Edition, and the Key Management Trap
Duende IdentityServer prices per edition, who gets the free Community Edition, and the default setting that quietly moves a migrated app up a tier.