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.
If you are leaving IdentityServer4 and the Duende licence doesn’t fit, OpenIddict is the option most .NET teams look at next: free, Apache-licensed, in-process, and happy to sit on top of the ASP.NET Core Identity database you already have. (A community fork buys time, not safety.) This post maps IdentityServer4 concepts onto OpenIddict one by one, shows where the work lands, and ends with the rule for picking OpenIddict or Duende.
The short answer
Duende is the same product as IdentityServer4, continued by its authors: you swap packages and namespaces and your configuration comes across, which is why our alternatives comparison puts that path at days to a few weeks. OpenIddict is a different design. Its README says it “is not a turnkey solution but a framework that requires writing custom code” (openiddict-core), typically at least an authorization controller. You keep your users and your client applications; you rewrite the server layer.
The less you customised IdentityServer4, the cheaper OpenIddict is.
A disclosure, so you can weigh what follows. We sell IdentityServer4 to Duende migrations, and we have not published an OpenIddict migration of our own. Everything below comes from OpenIddict’s documentation, its source and official samples, and IdentityServer4’s archived docs. It is a mapping and a decision guide, not a field report.
OpenIddict in November 2026
- Licence: Apache 2.0 (LICENSE.md), the same licence IdentityServer4 had.
- Version: 7.8.0 is the current stable release, published on 3 November 2026; 8.0 is in preview (NuGet, releases).
- Target frameworks:
OpenIddict.AspNetCore, the package a token server references, targets .NET 8, 9 and 10 plus .NET Framework 4.6.2–4.8 (NuGet). - Support: “offered only for the latest stable version” (support policy). Budget for following major versions; staying behind is how the IdentityServer4 situation started.
- Storage: EF Core, EF6 and MongoDB stores ship in the box (introduction).
IdentityServer4 → OpenIddict concept map
| IdentityServer4 | OpenIddict | Notes |
|---|---|---|
Client (configuration store) | Application (OpenIddictApplicationDescriptor, IOpenIddictApplicationManager) | Grant types, endpoints and scopes become application permissions. |
ClientSecrets (unsalted SHA-256 hashes) | ClientSecret, hashed by OpenIddict with PBKDF2 | No documented import: reissue secrets. See below. |
RequirePkce | Requirements.Features.ProofKeyForCodeExchange | Per application, or server-wide with RequireProofKeyForCodeExchange(). |
RequireConsent | ConsentType (implicit, explicit, external, systematic) | Consent logic lives in your authorization endpoint. |
ApiScope | Scope (OpenIddictScopeDescriptor) | Also registered on the server with RegisterScopes(). |
ApiResource | Resources on a scope, which become the aud claim | Set by your code with SetResources() (claim destinations). |
IdentityResource | Standard scopes such as profile and email | No declarative claim list: your code decides which claims go into which token. |
IProfileService | Your own code in the authorize, token and userinfo endpoints | The biggest conceptual change. |
IExtensionGrantValidator | AllowCustomFlow("your_grant") plus a branch in your token endpoint | Throws if you pass a built-in grant type. Token exchange (RFC 8693) is built in since 7.0. |
| Persisted grants: codes, refresh and reference tokens | Tokens table | Token storage |
| Persisted grants: remembered consent | Authorizations table | Authorization storage |
AddSigningCredential() | AddSigningCertificate() / AddSigningKey(), plus encryption credentials | OpenIddict also needs encryption credentials. Set the old kid explicitly; see below. |
Client.AllowedCorsOrigins / ICorsPolicyService | Nothing built in | Use ASP.NET Core’s CORS middleware; per-client origins need a custom ICorsPolicyProvider. |
| Quickstart UI (login, consent, logout) | Nothing; you build them | The samples show the pattern. |
Where the effort concentrates
You write the endpoints
IdentityServer4 implements /connect/authorize, /connect/token, /connect/userinfo and /connect/endsession and calls your extension points. OpenIddict validates the protocol request and then, in pass-through mode, hands it to your controller, Razor Page or middleware; invalid requests never reach your code (introduction). The Velusia sample server shows the full set.
Endpoint paths are yours to choose, so keep IdentityServer4’s and your clients never notice. A server configuration aimed at that, using the 7.8 API:
services.AddOpenIddict()
.AddCore(options => options.UseEntityFrameworkCore()
.UseDbContext<ApplicationDbContext>())
.AddServer(options =>
{
// Same paths IdentityServer4 used, so existing clients keep working.
options.SetAuthorizationEndpointUris("connect/authorize")
.SetTokenEndpointUris("connect/token")
.SetUserInfoEndpointUris("connect/userinfo")
.SetEndSessionEndpointUris("connect/endsession");
options.AllowAuthorizationCodeFlow()
.AllowClientCredentialsFlow()
.AllowRefreshTokenFlow();
options.RegisterScopes(Scopes.Email, Scopes.Profile, "api1");
// Same issuer string IdentityServer4 issued (check its discovery document).
options.SetIssuer(new Uri("https://login.example.com"));
// The certificate IdentityServer4 signed with, published under its old kid,
// plus a new encryption certificate.
options.AddSigningKey(new X509SecurityKey(identityServer4SigningCertificate)
{
KeyId = "<kid from the old jwks>"
})
.AddEncryptionCertificate(encryptionCertificate);
// IdentityServer4 issued signed, unencrypted JWT access tokens.
options.DisableAccessTokenEncryption();
options.UseAspNetCore()
.EnableAuthorizationEndpointPassthrough()
.EnableTokenEndpointPassthrough()
.EnableUserInfoEndpointPassthrough()
.EnableEndSessionEndpointPassthrough();
});
Every method above exists under that name in the 7.8.0 OpenIddictServerBuilder. If you copy code from older posts, OpenIddict 6.0 renamed several APIs: SetUserinfoEndpointUris became SetUserInfoEndpointUris, SetLogoutEndpointUris became SetEndSessionEndpointUris, and AllowDeviceCodeFlow became AllowDeviceAuthorizationFlow (6.0 migration guide). The IdentityServer4 Quickstart UI has no counterpart: login, consent, logout and error pages are your code.
The profile service becomes your claims code
In IdentityServer4, IProfileService.GetProfileDataAsync loads claims and IsActiveAsync decides whether a user may still get tokens (profile service). OpenIddict has no such hook. You build a ClaimsPrincipal in your endpoint and give each claim a destination; only sub is copied automatically (claim destinations). The IsActiveAsync check moves into the token endpoint, as in the samples.
Any claim an API reads today has to come out of the new code with the same type, value and format, so compare old and new tokens field by field before cutover.
Clients and secrets
Clients map cleanly into applications. A typical IdentityServer4 MVC client becomes:
await manager.CreateAsync(new OpenIddictApplicationDescriptor
{
ClientId = "mvc",
ClientSecret = mvcClientSecret, // plaintext; OpenIddict hashes it
ClientType = ClientTypes.Confidential,
ConsentType = ConsentTypes.Implicit,
RedirectUris = { new Uri("https://app.example.com/signin-oidc") },
PostLogoutRedirectUris = { new Uri("https://app.example.com/signout-callback-oidc") },
Permissions =
{
Permissions.Endpoints.Authorization,
Permissions.Endpoints.Token,
Permissions.Endpoints.EndSession,
Permissions.GrantTypes.AuthorizationCode,
Permissions.GrantTypes.RefreshToken,
Permissions.ResponseTypes.Code,
Permissions.Scopes.Profile,
Permissions.Prefixes.Scope + "api1"
},
Requirements = { Requirements.Features.ProofKeyForCodeExchange }
});
The catch is the secret. IdentityServer4 stores client secrets as unsalted SHA-256 hashes ("secret".Sha256() in its client docs). OpenIddict 7.8 hashes them with PBKDF2-HMAC-SHA256, a random salt and 10,000 iterations (source). Neither project documents an import, so plan to reissue secrets at cutover, or use the move to switch confidential clients to private_key_jwt client assertions. The manager’s ValidateClientSecretAsync is protected virtual, so you could subclass it to accept the old format, but that is undocumented and keeps a weak unsalted hash in service.
Tokens your APIs already accept
APIs protected with AddJwtBearer read the discovery document and the signing keys. To keep them working without a redeploy:
-
Sign with the same key, and the same
kid. IdentityServer4 signed JWTs with the key fromAddSigningCredential(crypto docs); register it with OpenIddict (credentials). Our Duende migration test showed that with a new key, neither side accepts the other’s tokens. Nothing about that is specific to Duende. Don’t assume the key ID carries over. IdentityServer4 4.x’sAddSigningCredential(certificate)took the certificate’s SHA-1 thumbprint and appended the algorithm, so itskidlooks like<thumbprint>RS256(4.1.2 source), and OpenIddict derives its own. Read thekidfrom your live/.well-known/openid-configuration/jwksand set it explicitly:var key = new X509SecurityKey(identityServer4SigningCertificate) { KeyId = "<kid from the old jwks>" }; options.AddSigningKey(key); -
Turn off access-token encryption. OpenIddict encrypts tokens by default;
DisableAccessTokenEncryption()relaxes that for access tokens (token formats). Skip it and APIs expecting signed JWTs can’t read the tokens. -
Pin the issuer. Without one, OpenIddict infers the issuer from the request. Set it with
SetIssuerto what IdentityServer4 issued (typically no trailing slash); a mismatch makes APIs reject tokens withIDX10205. Note that .NET’sUrirendershttps://hostashttps://host/, so check theissuerin the new discovery document rather than assuming. -
Diff the discovery document and JWKS. Check the issuer, the
kidvalues, theaudyour scopes produce, and the tokentypheader. OpenIddict issues access tokens with"typ": "at+jwt"(token formats).
Persisted grants: plan for one fresh sign-in
IdentityServer4 keeps authorization codes, refresh tokens, reference tokens and remembered consents in its persisted grant store (persisted grants). OpenIddict stores tokens and authorizations in its own formats, with random 256-bit reference identifiers (token storage), so an IdentityServer4 handle has nothing to resolve to, and no import is documented. Plan for one forced re-authentication: IdentityServer4 refresh tokens stop working at cutover and remembered consents are collected again. If that is unacceptable, for example with long-lived offline tokens on mobile, the alternative is custom handler code that validates the old grants, which adds a lot to the project.
This is the most visible difference from the Duende path, where live grants survived the schema migration.
Custom grants
IExtensionGrantValidator implementations (extension grants) become a custom flow: AllowCustomFlow("your_grant") on the server (it throws if you pass a built-in grant type), a Permissions.Prefixes.GrantType + "your_grant" permission on each application (application permissions), and a branch in your token endpoint. If your extension grant was a hand-rolled delegation or token-exchange flow, check OpenIddict 7’s built-in RFC 8693 support first (OpenIddict 7.0 announcement); you may be able to drop the custom grant.
If you are on ABP
The top search results for this migration are ABP’s step-by-step guide. It covers packages, modules, configuration and seeding clients from appsettings.json. It does not convert existing client rows, and it says nothing about secrets, persisted grants, kid continuity or pinning the issuer. The concerns above apply to ABP solutions too.
A migration order that keeps clients unchanged
- Inventory first. Clients, grant types, scopes and resources, custom grants, profile service, persisted grant store, signing keys: this is §1 of our Duende checklist, and it applies here unchanged.
- Count the custom parts. Each one is code you write, not configuration you copy.
- Seed applications and scopes from the inventory, in a script you can rerun, not by hand.
- Stand OpenIddict up next to IdentityServer4 with the same paths, signing key and issuer, then diff discovery, JWKS and issued tokens.
- Decide the secret and grant strategy before cutover: rotate or carry secrets, accept one fresh sign-in or write grant import code.
- Cut over with a rollback window, as in §6 of the checklist. Access tokens signed with the shared key stay valid at your APIs whichever server issued them, as long as issuer and audience match. Refresh tokens issued by OpenIddict will not work on IdentityServer4.
When OpenIddict is the better choice, and when Duende is
This follows the rule on our alternatives page. If you’d rather not run a token server at all, the managed route is covered in moving from IdentityServer to Microsoft Entra External ID.
OpenIddict is the better choice when your IdentityServer4 is close to stock: a handful of clients, standard flows, ASP.NET Core Identity behind it, little or no profile-service logic and no custom grants. It also fits when the Duende licence is a real share of what the product earns, or when you want a token server you fully own and a forced re-login at cutover is acceptable.
Duende is the better choice when you have custom grants, a profile service with real logic, many clients, refresh tokens your users must not lose, or a deadline of one sprint. Duende carries all of that across mostly unchanged, and for that kind of setup the licence usually costs less than the rewrite. Check the Community Edition and tier notes before deciding the licence doesn’t fit; more companies qualify than expect to.
If you can’t tell which group you are in, that is the question our IdentityServer consulting session answers. We go through the inventory with you, and you leave knowing whether your path is Duende or OpenIddict.
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.
Duende IdentityServer 8 Example: Server, API and MVC Client on .NET 10 (Real Code)
A working Duende IdentityServer 8 example on .NET 10: EF stores, an MVC code-flow client and a JWT-protected API, quoted from a public repo you can run.
OpenID Connect (OIDC) in .NET Core
How OpenID Connect works, how it differs from OAuth 2.0 and SAML, and which .NET Core frameworks implement it, IdentityServer4 and Duende among them.