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 to OpenIddict from Identity Server. From now on the ABP startup templates uses OpenIddict as the auth server by default since version v6.0.0.
We are not removing Identity Server packages and we will continue to release new versions of Identity Server related NuGet/NPM packages. That means you won't have an issue while upgrading to v6.0 when the stable version releases. We will continue to fix bugs in our packages for a while. ABP 7.0 will be based on .NET 7. If Identity Server continues to work with .NET 7, we will also continue to ship NuGet packages for our IDS integration.
On the other hand, Identity Server ends support for the open-source Identity Server in the end of 2022. The Identity Server team has decided to move to Duende IDS and ABP will not be migrated to the commercial Duende IDS. You can see the Duende Identity Server announcement from this link.
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();
});
});
}
ForwardIdentityAuthenticationForBearerprivate void ConfigureAuthentication(ServiceConfigurationContext context)
{
context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme);
}
IdentityServerDataSeedContributor from the Domain project.ProjectName.Domain\OpenIddict\OpenIddictDataSeedContributor.cs of new project into your project and update appsettings.json base on ProjectName.DbMigrator\appsettings.json, Be careful to change the port number.Index.cshtml.cs and Index.cs of new project to your project if you're using IClientRepository in IndexModel.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)