Duende IdentityServer v5.2 to v6.0-preview-1

This upgrade guide covers upgrading from Duende IdentityServer v5.2 to v6.0-preview-1 (release notes). The most significant aspect of this upgrade is that Duende IdentityServer v6.0 targets .NET 6. Other than that, much like our prior updates, there’s not much to do!

Step 1: Update to .NET 6

In your IdentityServer host project, update the version of the .NET framework. For example in your project file:

<TargetFramework>netcoreapp3.1</TargetFramework>

would change to:

<TargetFramework>net6.0</TargetFramework>

Also, any other NuGets that you were previously using that targeted an older version of .NET should be updated. For example, Microsoft.EntityFrameworkCore.SqlServer or Microsoft.AspNetCore.Authentication.Google. Depending on what your application was using, there may or may not be code changes based on those updated NuGet packages.

Step 2: Update the IdentityServer NuGet package

In your IdentityServer host project, update the version of the Duende IdentityServer NuGet. For example in your project file:

<PackageReference Include="Duende.IdentityServer" Version="5.2.0" />

would change to:

<PackageReference Include="Duende.IdentityServer" Version="6.0.0-preview.1" />

Step 3: Update Database Schema (if needed)

If you are using a database for your configuration data, then there is a small database schema update. This includes:

  • Add missing columns for created, updated, etc to EF entities (more details).
  • Add unique constraints to EF tables where duplicate records not allowed (more details).

If you are using the Duende.IdentityServer.EntityFramework package as the implementation for the database and you’re using EntityFramework Core migrations as the mechanism for managing those schema changes over time, the commands below will update those migrations with the new changes. Note that you might need to adjust based on your specific organization of the migration files.

dotnet ef migrations add Update_DuendeIdentityServer_v6_0 -c ConfigurationDbContext -o Data/Migrations/IdentityServer/ConfigurationDb

Then to apply those changes to your database:

dotnet ef database update -c ConfigurationDbContext

Step 4: Done!

That’s it. Of course, at this point you can and should test that your IdentityServer is updated and working properly.