OpenIddict Blazor Wasm UI Migration Guide
Blazor Project
In the MyApplication.Blazor.csproj replace project references:
with
In the MyApplicationBlazorModule.cs replace usings and module dependencies:
with
In the MyApplicationBlazorModule.cs update the
ConfigureAuthentication
method:Remove
options.UserOptions.RoleClaim = JwtClaimTypes.Role;
and updaterole
scope toroles
.In the MyApplicationMenuContributor.cs under Navigation folder, replace the using and menu name under
ConfigureMainMenuAsync
:with
Http.Api.Host (Non-Separated IdentityServer)
In the MyApplication.HttpApi.Host.csproj replace project references:
with
In the MyApplicationHttpApiHostModule.cs replace usings and module dependencies:
with
In the MyApplicationHostModule.cs add
PreConfigureServices
like below with your application name as the audience:In the MyApplicationHostModule.cs
ConfigureServices
method, replace the method call:From
ConfigureAuthentication(context, configuration);
toConfigureAuthentication(context);
and update the method as:In the MyApplicationHostModule.cs
OnApplicationInitialization
method, replace the midware:with
app.UseAbpOpenIddictValidation();
Delete
c.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
inapp.UseAbpSwaggerUI
options configurations which is no longer needed.In
appsettings.json
delete SwaggerClientSecret from the AuthServer section like below:
Http.Api.Host (Separated IdentityServer)
In the MyApplicationHttpApiHostModule.cs
OnApplicationInitialization
method, deletec.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
inapp.UseAbpSwaggerUI
options configurations which is no longer needed.In
appsettings.json
delete SwaggerClientSecret from the AuthServer section like below:
IdentityServer
This project is renamed to AuthServer after v6.0.0. You can also refactor and rename your project to AuthServer for easier updates in the future.
In MyApplication.IdentityServer.csproj replace project references:
with
In the MyApplicationIdentityServerModule.cs replace usings and module dependencies:
with
In the MyApplicationIdentityServerModule.cs add
PreConfigureServices
like below with your application name as the audience:In the MyApplicationIdentityServerModule.cs replace ForwardIdentityAuthenticationForBearer under
ConfigureServices
method:with
In the MyApplicationIdentityServerModule.cs, remove IdentityServerOptions configuration and JwtBearer options under
ConfigureServices
method:In the MyApplicationIdentityServerModule.cs
OnApplicationInitialization
method, replace the midware:with
To use the new AuthServer page, replace Index.cshtml.cs with AuthServer Index.cshtml.cs and Index.cshtml file with AuthServer Index.cshtml.
Note: It can be found under the Pages folder.