Skip to content
Alex Hovy.
← All articles
Security

Replacing an identity server: ASP.NET Core Identity and OpenIddict

Migration considerations for user management, OAuth/OpenID Connect contracts, credentials and operations, with clear distinctions between identity products.

Alex HovyPublished Updated
On this page

Replacing an identity server is a protocol and operations decision, not simply swapping a login library. This article explains the responsibilities and migration questions around Duende IdentityServer, ASP.NET Core Identity and OpenIddict.

Separate the responsibilities

ASP.NET Core Identity manages application users, password hashes, roles and related account functionality. It is not, by itself, a drop-in OAuth/OpenID Connect authorization server.

Microsoft identity platform, associated with Microsoft Entra, is a different product and service context. Calling both products “Microsoft Identity” obscures important differences.

OpenIddict provides OAuth/OpenID Connect stacks that can be used with application user management. A working authorization server still requires deliberate application, protocol and operational configuration. Use the framework's supported behavior instead of implementing token validation or PKCE from scratch.

Establish the existing contract

Before selecting a replacement, identify the supported clients, grant types, redirect URIs, scopes, claims, consent requirements and user-management flows. Review discovery metadata, issuer/audience expectations and downstream API validation. Preserve only the behavior that is actually needed and safe.

Licensing is one input. Duende's terms, editions and eligibility conditions should be checked against its current documentation; it is inaccurate to imply that every production use has identical licensing requirements. Replacing a component can change support, maintenance and operational costs as well as license expense.

Credential and session migration

Moving user records is not proof that password verification will remain compatible. Password-hash formats, parameters, external identities, multifactor enrollment and account-recovery behavior need explicit testing. Do not assume that another library can verify an existing database without a compatible implementation.

Plan how existing sessions, refresh tokens and access tokens behave during the transition. A changed issuer, audience, signing key or token format can invalidate clients and APIs even when the user database is unchanged. Rollback and a bounded transition need consideration alongside the successful login path.

Keys and certificates have different purposes

Signing credentials protect tokens against tampering; encryption credentials protect token content. OpenIddict's optional ASP.NET Core Data Protection integration uses its own key ring. Those mechanisms are not interchangeable, and machine-default Data Protection keys are not a general replacement for production signing/encryption credentials.

Select credentials following the library's production guidance. Plan persistence, access control, rotation and behavior across application instances. Development-only credentials are not a production key-management strategy.

Validate the protocol behavior

Use current OAuth security guidance, including appropriate authorization-code and PKCE handling. Validate redirect URIs and token purpose, issuer, audience, signature and lifetime. Exercise error paths, logout, expiry, rotation, permission changes and recovery—not only successful token generation.

Authentication and authorisation remain separate responsibilities after a migration. Correctly issuing a token does not establish that every API resource is protected.

Evaluate the result honestly

Compare the maintained behavior, operational responsibilities and support requirements before making claims about security, scalability or total cost. A successful migration can be described without publishing client-specific services, credentials, endpoints or infrastructure details. Specific historical savings and implementation outcomes require evidence; they are not inferred from the choice of library.

References