docs/en/release-info/migration-guides/identityserver-to-openiddict.md
//[doc-seo]
{
"Description": "Learn how to migrate from Identity Server to OpenIddict in ABP Framework with this comprehensive guide, ensuring a smooth transition."
}
This document explains how to migrate an application from IdentityServer4 to OpenIddict. ABP startup templates have used OpenIddict as the authentication server by default since v6.0.0.
The checklist below describes the v6.0 transition. For a layer-by-layer migration, use the IdentityServer to OpenIddict step-by-step guide and apply the package version that matches the ABP version of your application.
IdentityServer4 is archived and no longer maintained by its owners. ABP did not migrate its integration to the commercial Duende IdentityServer product. The ABP IdentityServer integration packages are still shipped for existing applications, while new applications use OpenIddict. See the Duende IdentityServer announcement for the background.
Volo's packages to 6.x.Volo's IdentityServer.* packages with corresponding OpenIddict.* packages. eg Volo.Abp.IdentityServer.Domain to Volo.Abp.OpenIddict.Domain, Volo.Abp.Account.Web.IdentityServer to Volo.Abp.Account.Web.OpenIddict.IdentityServer modules with corresponding OpenIddict modules. eg AbpIdentityServerDomainModule to AbpOpenIddictDomainModule, AbpAccountWebIdentityServerModule to AbpAccountWebOpenIddictModule.ConfigureIdentityServer to ConfigureOpenIddict in your ProjectNameDbContext class.UseIdentityServer and add UseAbpOpenIddictValidation after UseAuthentication.public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<OpenIddictBuilder>(builder =>
{
builder.AddValidation(options =>
{
options.AddAudiences("ProjectName"); // Change ProjectName to your project name.
options.UseLocalServer();
options.UseAspNetCore();
});
});
}
ForwardIdentityAuthenticationForBearer.private void ConfigureAuthentication(ServiceConfigurationContext context)
{
context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme);
}
IdentityServerDataSeedContributor from the Domain project.ProjectName.Domain\OpenIddict\OpenIddictDataSeedContributor.cs into your project and update appsettings.json based on ProjectName.DbMigrator\appsettings.json. Adjust the ports and client URLs for your application.Index.cshtml.cs and Index.cshtml files into your project if your IndexModel still uses IClientRepository.role to roles in AddAbpOpenIdConnect method.options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); from HttpApi.Host project.JWT bearer authentication. Please remove it. eg AddJwtBearer and UseJwtTokenMiddleware.AbpOpenIddictDomainModule)AbpOpenIddictDomainSharedModule)AbpOpenIddictEntityFrameworkCoreModule)AbpOpenIddictAspNetCoreModule)AbpOpenIddictMongoDbModule)AbpAccountWebOpenIddictModule)AbpPermissionManagementDomainOpenIddictModule)AbpOpenIddictProApplicationContractsModule)AbpOpenIddictProApplicationModule)AbpOpenIddictProHttpApiClientModule)AbpOpenIddictProHttpApiModule)AbpOpenIddictProBlazorModule)AbpOpenIddictProBlazorServerModule)AbpOpenIddictProBlazorWebAssemblyModule)AbpOpenIddictProWebModule)