diff --git a/eng/Dependencies.props b/eng/Dependencies.props
index b0904d2b241368b7ae0a6a99dc92f87925a6b020..f4594285e69cf11cb550de1d53a64adf8b5e808f 100644
--- a/eng/Dependencies.props
+++ b/eng/Dependencies.props
@@ -160,17 +160,17 @@ and are generated based on the last package release.
     <LatestPackageReference Include="AngleSharp" />
     <LatestPackageReference Include="BenchmarkDotNet" />
     <LatestPackageReference Include="CommandLineParser" />
+    <LatestPackageReference Include="Duende.IdentityServer" />
+    <LatestPackageReference Include="Duende.IdentityServer.AspNetIdentity" />
+    <LatestPackageReference Include="Duende.IdentityServer.EntityFramework" />
+    <LatestPackageReference Include="Duende.IdentityServer.EntityFramework.Storage" />
+    <LatestPackageReference Include="Duende.IdentityServer.Storage" />
     <LatestPackageReference Include="FSharp.Core" />
     <LatestPackageReference Include="Google.Protobuf" />
     <LatestPackageReference Include="Grpc.AspNetCore" />
     <LatestPackageReference Include="Grpc.Auth" />
     <LatestPackageReference Include="Grpc.Net.Client" />
     <LatestPackageReference Include="Grpc.Tools" />
-    <LatestPackageReference Include="IdentityServer4" />
-    <LatestPackageReference Include="IdentityServer4.AspNetIdentity" />
-    <LatestPackageReference Include="IdentityServer4.EntityFramework" />
-    <LatestPackageReference Include="IdentityServer4.EntityFramework.Storage" />
-    <LatestPackageReference Include="IdentityServer4.Storage" />
     <LatestPackageReference Include="Libuv" />
     <LatestPackageReference Include="MessagePack" />
     <LatestPackageReference Include="MessagePackAnalyzer" />
diff --git a/eng/Versions.props b/eng/Versions.props
index e88cf23d549e0dcd6335f9387168bdc98eb8f8a2..89ac7f512236d2d3134d2d6fc65def44013299d7 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -229,11 +229,11 @@
     <GrpcAuthVersion>2.32.0</GrpcAuthVersion>
     <GrpcNetClientVersion>2.32.0</GrpcNetClientVersion>
     <GrpcToolsVersion>2.32.0</GrpcToolsVersion>
-    <IdentityServer4AspNetIdentityVersion>4.1.0</IdentityServer4AspNetIdentityVersion>
-    <IdentityServer4EntityFrameworkVersion>4.1.0</IdentityServer4EntityFrameworkVersion>
-    <IdentityServer4Version>4.1.0</IdentityServer4Version>
-    <IdentityServer4StorageVersion>4.1.0</IdentityServer4StorageVersion>
-    <IdentityServer4EntityFrameworkStorageVersion>4.1.0</IdentityServer4EntityFrameworkStorageVersion>
+    <DuendeIdentityServerAspNetIdentityVersion>5.2.0</DuendeIdentityServerAspNetIdentityVersion>
+    <DuendeIdentityServerEntityFrameworkVersion>5.2.0</DuendeIdentityServerEntityFrameworkVersion>
+    <DuendeIdentityServerVersion>5.2.0</DuendeIdentityServerVersion>
+    <DuendeIdentityServerStorageVersion>5.2.0</DuendeIdentityServerStorageVersion>
+    <DuendeIdentityServerEntityFrameworkStorageVersion>5.2.0</DuendeIdentityServerEntityFrameworkStorageVersion>
     <MessagePackVersion>2.1.90</MessagePackVersion>
     <MicrosoftIdentityWebVersion>1.14.1</MicrosoftIdentityWebVersion>
     <MicrosoftIdentityWebMicrosoftGraphVersion>1.1.0</MicrosoftIdentityWebMicrosoftGraphVersion>
diff --git a/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/ApplicationDbContext.cs b/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/ApplicationDbContext.cs
index dbb7e235131da34c5146339b46003c6f2d8cde46..ae1031562b223b335fc400c98f65788e57c95aa4 100644
--- a/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/ApplicationDbContext.cs
+++ b/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/ApplicationDbContext.cs
@@ -1,5 +1,5 @@
 using Wasm.Authentication.Server.Models;
-using IdentityServer4.EntityFramework.Options;
+using Duende.IdentityServer.EntityFramework.Options;
 using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.Options;
diff --git a/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/Migrations/20200324213904_Initial.Designer.cs b/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/Migrations/20200324213904_Initial.Designer.cs
index 5a9de57b6de8b1e8456f063ba2edc65ce3c236b9..0bdcef9eb0c039b927d9b0c1beae75c420423e6c 100644
--- a/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/Migrations/20200324213904_Initial.Designer.cs
+++ b/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/Migrations/20200324213904_Initial.Designer.cs
@@ -18,7 +18,7 @@ namespace Wasm.Authentication.Server.Data.Migrations
             modelBuilder
                 .HasAnnotation("ProductVersion", "3.1.2");
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b =>
                 {
                     b.Property<string>("UserCode")
                         .HasColumnType("TEXT")
@@ -60,7 +60,43 @@ namespace Wasm.Authentication.Server.Data.Migrations
                     b.ToTable("DeviceCodes");
                 });
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b =>
+                {
+                    b.Property<string>("Id")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Algorithm")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(100);
+
+                    b.Property<DateTime>("Created")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("Data")
+                        .IsRequired()
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("DataProtected")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("IsX509Certificate")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("Use")
+                        .HasColumnType("TEXT");
+
+                    b.Property<int>("Version")
+                        .HasColumnType("int");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Use");
+
+                    b.ToTable("Keys");
+                });
+
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b =>
                 {
                     b.Property<string>("Key")
                         .HasColumnType("TEXT")
diff --git a/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/Migrations/20200324213904_Initial.cs b/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/Migrations/20200324213904_Initial.cs
index fcafd568d1e4bf7439376da8d155da3f10b2a1de..22fd95f30fe12a78032ea0b7c8be4a9410a27300 100644
--- a/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/Migrations/20200324213904_Initial.cs
+++ b/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/Migrations/20200324213904_Initial.cs
@@ -63,6 +63,24 @@ namespace Wasm.Authentication.Server.Data.Migrations
                     table.PrimaryKey("PK_DeviceCodes", x => x.UserCode);
                 });
 
+            migrationBuilder.CreateTable(
+                name: "Keys",
+                columns: table => new
+                {
+                    Id = table.Column<string>(nullable: false),
+                    Version = table.Column<int>(nullable: false),
+                    Created = table.Column<DateTime>(nullable: false),
+                    Use = table.Column<string>(nullable: true),
+                    Algorithm = table.Column<string>(maxLength: 100, nullable: false),
+                    IsX509Certificate = table.Column<bool>(nullable: false),
+                    DataProtected = table.Column<bool>(nullable: false),
+                    Data = table.Column<string>(nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Keys", x => x.Id);
+                });
+
             migrationBuilder.CreateTable(
                 name: "PersistedGrants",
                 columns: table => new
@@ -253,6 +271,16 @@ namespace Wasm.Authentication.Server.Data.Migrations
                 table: "DeviceCodes",
                 column: "Expiration");
 
+            migrationBuilder.CreateIndex(
+                name: "IX_Keys_Use",
+                table: "Keys",
+                column: "Use");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_PersistedGrants_ConsumedTime",
+                table: "PersistedGrants",
+                column: "ConsumedTime");
+
             migrationBuilder.CreateIndex(
                 name: "IX_PersistedGrants_Expiration",
                 table: "PersistedGrants",
@@ -290,6 +318,9 @@ namespace Wasm.Authentication.Server.Data.Migrations
             migrationBuilder.DropTable(
                 name: "DeviceCodes");
 
+           migrationBuilder.DropTable(
+                name: "Keys");
+
             migrationBuilder.DropTable(
                 name: "PersistedGrants");
 
diff --git a/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/Migrations/ApplicationDbContextModelSnapshot.cs
index c68c2e09660c14e171109db40b4d966d3e754e8a..1bbf5f9b4576a8708295e519e49bb1aab3b6274c 100644
--- a/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/Migrations/ApplicationDbContextModelSnapshot.cs
+++ b/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Data/Migrations/ApplicationDbContextModelSnapshot.cs
@@ -16,7 +16,7 @@ namespace Wasm.Authentication.Server.Data.Migrations
             modelBuilder
                 .HasAnnotation("ProductVersion", "5.0.0-rc.1.20416.1");
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b =>
                 {
                     b.Property<string>("UserCode")
                         .HasMaxLength(200)
@@ -66,7 +66,46 @@ namespace Wasm.Authentication.Server.Data.Migrations
                     b.ToTable("DeviceCodes");
                 });
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b =>
+                {
+                    b.Property<string>("Id")
+                        .HasMaxLength(450)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Algorithm")
+                        .IsRequired()
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("Created")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Data")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(50000);
+                        
+                    b.Property<bool>("DataProtected")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("IsX509Certificate")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("Use")
+                        .HasMaxLength(450)
+                        .HasColumnType("TEXT");
+
+                    b.Property<int>("Version")
+                        .HasColumnType("int");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Use");
+
+                    b.ToTable("Keys");
+                });
+
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b =>
                 {
                     b.Property<string>("Key")
                         .HasMaxLength(200)
diff --git a/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Wasm.Authentication.Server.csproj b/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Wasm.Authentication.Server.csproj
index cdf4e7684bd69c59f1449110383ef57282c2cf36..7e19f1566fe950147bb112075e64d8451caf9d6e 100644
--- a/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Wasm.Authentication.Server.csproj
+++ b/src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Wasm.Authentication.Server.csproj
@@ -3,6 +3,8 @@
   <PropertyGroup>
     <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
 
+    <!-- IdentityServer packages are not strong named. -->
+    <NoWarn>CS8002</NoWarn>
     <!-- This project references the shared framework transitively. Prevent restore errors by setting this flag. -->
     <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
   </PropertyGroup>
diff --git a/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/ApiAuthSample.csproj b/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/ApiAuthSample.csproj
index fc7fd6784f5abfa793a27bdc5c3ece5272bf4f3e..ec21f0bbc980af360a4fe3b6b2ec8a4fe377ed32 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/ApiAuthSample.csproj
+++ b/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/ApiAuthSample.csproj
@@ -3,13 +3,15 @@
   <PropertyGroup>
     <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <UserSecretsId>aspnet-ApiAuthSample-12ED8ECC-9EF1-4D31-87B4-1405B3198E5E</UserSecretsId>
+    <!-- IdentityServer packages are not strong named -->
+    <NoWarn>CS8002</NoWarn>
     <!-- We are a package that depends on the shared framework, this allows us to
          avoid errors during restore -->
     <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
   </PropertyGroup>
 
   <ItemGroup>
-    <!-- Remove the reference to Microsoft.AspNetCore.App from IdentityServer4 -->
+    <!-- Remove the reference to Microsoft.AspNetCore.App from Duende.IdentityServer -->
     <FrameworkReference Remove="Microsoft.AspNetCore.App" />
     <Reference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" />
     <Reference Include="Microsoft.AspNetCore.CookiePolicy" />
diff --git a/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/ApplicationDbContext.cs b/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/ApplicationDbContext.cs
index cb0f0e9eed2856c8a97ab8f2a06a0741d995c1d1..80618e816349f702bee63e4db852e308b0f6cbca 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/ApplicationDbContext.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/ApplicationDbContext.cs
@@ -1,4 +1,4 @@
-using IdentityServer4.EntityFramework.Options;
+using Duende.IdentityServer.EntityFramework.Options;
 using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.Options;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/20180919224505_InitialMigration.Designer.cs b/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/20180919224505_InitialMigration.Designer.cs
index ae62ed80fc8578cbe3e9fde3fd399ebe82c55c25..421d375524f0886c69cad6ae861aecd58f67e996 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/20180919224505_InitialMigration.Designer.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/20180919224505_InitialMigration.Designer.cs
@@ -18,32 +18,119 @@ namespace ApiAuthSample.Data.Migrations
             modelBuilder
                 .HasAnnotation("ProductVersion", "2.1.3-rtm-32065");
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b =>
+                {
+                    b.Property<string>("UserCode")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(200);
+
+                    b.Property<string>("ClientId")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(200);
+
+                    b.Property<DateTime>("CreationTime")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Data")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(50000);
+
+                    b.Property<string>("DeviceCode")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(200);
+
+                    b.Property<DateTime?>("Expiration")
+                        .IsRequired()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("SubjectId")
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(200);
+
+                    b.HasKey("UserCode");
+
+                    b.HasIndex("DeviceCode")
+                        .IsUnique();
+
+                    b.HasIndex("Expiration");
+
+                    b.ToTable("DeviceCodes");
+                });
+
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b =>
+                {
+                    b.Property<string>("Id")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Algorithm")
+                        .IsRequired()
+                        .HasColumnType("TEXT")
+                        .HasMaxLength(100);
+
+                    b.Property<DateTime>("Created")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("Data")
+                        .IsRequired()
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("DataProtected")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("IsX509Certificate")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("Use")
+                        .HasColumnType("TEXT");
+
+                    b.Property<int>("Version")
+                        .HasColumnType("int");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Use");
+
+                    b.ToTable("Keys");
+                });
+
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b =>
                 {
                     b.Property<string>("Key")
+                        .HasColumnType("TEXT")
                         .HasMaxLength(200);
 
                     b.Property<string>("ClientId")
                         .IsRequired()
+                        .HasColumnType("TEXT")
                         .HasMaxLength(200);
 
-                    b.Property<DateTime>("CreationTime");
+                    b.Property<DateTime>("CreationTime")
+                        .HasColumnType("TEXT");
 
                     b.Property<string>("Data")
                         .IsRequired()
+                        .HasColumnType("TEXT")
                         .HasMaxLength(50000);
 
-                    b.Property<DateTime?>("Expiration");
+                    b.Property<DateTime?>("Expiration")
+                        .HasColumnType("TEXT");
 
                     b.Property<string>("SubjectId")
+                        .HasColumnType("TEXT")
                         .HasMaxLength(200);
 
                     b.Property<string>("Type")
                         .IsRequired()
+                        .HasColumnType("TEXT")
                         .HasMaxLength(50);
 
                     b.HasKey("Key");
 
+                    b.HasIndex("Expiration");
+
                     b.HasIndex("SubjectId", "ClientId", "Type");
 
                     b.ToTable("PersistedGrants");
diff --git a/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/20180919224505_InitialMigration.cs b/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/20180919224505_InitialMigration.cs
index e801149f5f95b745def8936104dcee8bf1a7a2f0..e8ad17c6a19c4684d8d5e4e503e7b56bf15c6490 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/20180919224505_InitialMigration.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/20180919224505_InitialMigration.cs
@@ -46,6 +46,41 @@ namespace ApiAuthSample.Data.Migrations
                     table.PrimaryKey("PK_AspNetUsers", x => x.Id);
                 });
 
+            migrationBuilder.CreateTable(
+                name: "DeviceCodes",
+                columns: table => new
+                {
+                    UserCode = table.Column<string>(maxLength: 200, nullable: false),
+                    DeviceCode = table.Column<string>(maxLength: 200, nullable: false),
+                    SubjectId = table.Column<string>(maxLength: 200, nullable: true),
+                    ClientId = table.Column<string>(maxLength: 200, nullable: false),
+                    CreationTime = table.Column<DateTime>(nullable: false),
+                    Expiration = table.Column<DateTime>(nullable: false),
+                    Data = table.Column<string>(maxLength: 50000, nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_DeviceCodes", x => x.UserCode);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Keys",
+                columns: table => new
+                {
+                    Id = table.Column<string>(nullable: false),
+                    Version = table.Column<int>(nullable: false),
+                    Created = table.Column<DateTime>(nullable: false),
+                    Use = table.Column<string>(nullable: true),
+                    Algorithm = table.Column<string>(maxLength: 100, nullable: false),
+                    IsX509Certificate = table.Column<bool>(nullable: false),
+                    DataProtected = table.Column<bool>(nullable: false),
+                    Data = table.Column<string>(nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Keys", x => x.Id);
+                });
+
             migrationBuilder.CreateTable(
                 name: "PersistedGrants",
                 columns: table => new
@@ -206,10 +241,41 @@ namespace ApiAuthSample.Data.Migrations
                 column: "NormalizedUserName",
                 unique: true);
 
+            migrationBuilder.CreateIndex(
+                name: "IX_DeviceCodes_DeviceCode",
+                table: "DeviceCodes",
+                column: "DeviceCode",
+                unique: true);
+
+            migrationBuilder.CreateIndex(
+                name: "IX_DeviceCodes_Expiration",
+                table: "DeviceCodes",
+                column: "Expiration");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Keys_Use",
+                table: "Keys",
+                column: "Use");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_PersistedGrants_ConsumedTime",
+                table: "PersistedGrants",
+                column: "ConsumedTime");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_PersistedGrants_Expiration",
+                table: "PersistedGrants",
+                column: "Expiration");
+
             migrationBuilder.CreateIndex(
                 name: "IX_PersistedGrants_SubjectId_ClientId_Type",
                 table: "PersistedGrants",
                 columns: new[] { "SubjectId", "ClientId", "Type" });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_PersistedGrants_SubjectId_SessionId_Type",
+                table: "PersistedGrants",
+                columns: new[] { "SubjectId", "SessionId", "Type" });
         }
 
         protected override void Down(MigrationBuilder migrationBuilder)
@@ -229,6 +295,12 @@ namespace ApiAuthSample.Data.Migrations
             migrationBuilder.DropTable(
                 name: "AspNetUserTokens");
 
+            migrationBuilder.DropTable(
+                name: "DeviceCodes");
+
+            migrationBuilder.DropTable(
+                name: "Keys");
+
             migrationBuilder.DropTable(
                 name: "PersistedGrants");
 
diff --git a/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/ApplicationDbContextModelSnapshot.cs
index 23b1f3414fe9c09e2e35b0df2ec5dc9438a37968..1055d1c700a8e1f7749a994f5af8a4e12b9b9c3b 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/ApplicationDbContextModelSnapshot.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/ApplicationDbContextModelSnapshot.cs
@@ -16,34 +16,145 @@ namespace ApiAuthSample.Data.Migrations
             modelBuilder
                 .HasAnnotation("ProductVersion", "2.1.3-rtm-32065");
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b =>
                 {
-                    b.Property<string>("Key")
-                        .HasMaxLength(200);
+                    b.Property<string>("UserCode")
+                        .HasMaxLength(200)
+                        .HasColumnType("TEXT");
 
                     b.Property<string>("ClientId")
                         .IsRequired()
-                        .HasMaxLength(200);
+                        .HasMaxLength(200)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("CreationTime")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Data")
+                        .IsRequired()
+                        .HasMaxLength(50000)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Description")
+                        .HasMaxLength(200)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("DeviceCode")
+                        .IsRequired()
+                        .HasMaxLength(200)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime?>("Expiration")
+                        .IsRequired()
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("SessionId")
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("SubjectId")
+                        .HasMaxLength(200)
+                        .HasColumnType("TEXT");
+
+                    b.HasKey("UserCode");
+
+                    b.HasIndex("DeviceCode")
+                        .IsUnique();
+
+                    b.HasIndex("Expiration");
+
+                    b.ToTable("DeviceCodes");
+                });
+
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b =>
+                {
+                    b.Property<string>("Id")
+                        .HasMaxLength(450)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Algorithm")
+                        .IsRequired()
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
 
-                    b.Property<DateTime>("CreationTime");
+                    b.Property<DateTime>("Created")
+                        .HasColumnType("TEXT");
 
                     b.Property<string>("Data")
                         .IsRequired()
+                        .HasColumnType("TEXT")
                         .HasMaxLength(50000);
+                        
+                    b.Property<bool>("DataProtected")
+                        .HasColumnType("bit");
 
-                    b.Property<DateTime?>("Expiration");
+                    b.Property<bool>("IsX509Certificate")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("Use")
+                        .HasMaxLength(450)
+                        .HasColumnType("TEXT");
+
+                    b.Property<int>("Version")
+                        .HasColumnType("int");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Use");
+
+                    b.ToTable("Keys");
+                });
+
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b =>
+                {
+                    b.Property<string>("Key")
+                        .HasMaxLength(200)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("ClientId")
+                        .IsRequired()
+                        .HasMaxLength(200)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime?>("ConsumedTime")
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("CreationTime")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Data")
+                        .IsRequired()
+                        .HasMaxLength(50000)
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Description")
+                        .HasMaxLength(200)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime?>("Expiration")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("SessionId")
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
 
                     b.Property<string>("SubjectId")
-                        .HasMaxLength(200);
+                        .HasMaxLength(200)
+                        .HasColumnType("TEXT");
 
                     b.Property<string>("Type")
                         .IsRequired()
-                        .HasMaxLength(50);
+                        .HasMaxLength(50)
+                        .HasColumnType("TEXT");
 
                     b.HasKey("Key");
 
+                    b.HasIndex("Expiration");
+
                     b.HasIndex("SubjectId", "ClientId", "Type");
 
+                    b.HasIndex("SubjectId", "SessionId", "Type");
+
                     b.ToTable("PersistedGrants");
                 });
 
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/ApiAuthorizationDbContext.cs b/src/Identity/ApiAuthorization.IdentityServer/src/ApiAuthorizationDbContext.cs
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Authentication/AuthenticationBuilderExtensions.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Authentication/AuthenticationBuilderExtensions.cs
index 65d2c327fa4c288d2b4da06eff962dacf30e9f18..6fa1abbdfbfb46b124cd59e7cf19865a9ebff337 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Authentication/AuthenticationBuilderExtensions.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Authentication/AuthenticationBuilderExtensions.cs
@@ -2,7 +2,7 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 using System;
-using IdentityServer4.Stores;
+using Duende.IdentityServer.Stores;
 using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
 using Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Authentication;
 using Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Configuration;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Authentication/IdentityServerJwtBearerOptionsConfiguration.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Authentication/IdentityServerJwtBearerOptionsConfiguration.cs
index 3e7c002a3decb5d08597de3f49579fe8f03d30d1..9d9654bc8cdc44884db191e806d4e935fcc12be5 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Authentication/IdentityServerJwtBearerOptionsConfiguration.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Authentication/IdentityServerJwtBearerOptionsConfiguration.cs
@@ -2,8 +2,8 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 using System;
-using IdentityServer4.Extensions;
-using IdentityServer4.Stores;
+using Duende.IdentityServer.Extensions;
+using Duende.IdentityServer.Stores;
 using Microsoft.AspNetCore.Authentication.JwtBearer;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Configuration;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ApplicationProfilesPropertyNames.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ApplicationProfilesPropertyNames.cs
index 67372253809c9b7812d1dd647c85709e135cba00..0588c4abb856c3b222156e035922541bbfbf6647 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ApplicationProfilesPropertyNames.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ApplicationProfilesPropertyNames.cs
@@ -1,7 +1,7 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-using IdentityServer4.Models;
+using Duende.IdentityServer.Models;
 
 namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
 {
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ApplicationProfilesPropertyValues.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ApplicationProfilesPropertyValues.cs
index 9fba8195fac1361133728f95b781f90eaea2913f..cedefb2f9877ff9877c5a5265f6954f81fc6a95d 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ApplicationProfilesPropertyValues.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ApplicationProfilesPropertyValues.cs
@@ -1,7 +1,7 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-using IdentityServer4.Models;
+using Duende.IdentityServer.Models;
 
 namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
 {
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/AspNetConventionsConfigureOptions.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/AspNetConventionsConfigureOptions.cs
index 9699941961d6800c900f20b0becebfaf8a14608f..04a9fd33d88b1abb4713049c747541d1654610c9 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/AspNetConventionsConfigureOptions.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/AspNetConventionsConfigureOptions.cs
@@ -1,7 +1,7 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-using IdentityServer4.Configuration;
+using Duende.IdentityServer.Configuration;
 using Microsoft.AspNetCore.Identity;
 using Microsoft.Extensions.Options;
 
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureApiResources.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureApiResources.cs
index 27fa9f614ce23504b876730afe6338c361501f49..ac1ac6d1af21ff24655e3563f9657cae1b15efb7 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureApiResources.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureApiResources.cs
@@ -3,7 +3,7 @@
 
 using System;
 using System.Collections.Generic;
-using IdentityServer4.Models;
+using Duende.IdentityServer.Models;
 using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
 using Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Configuration;
 using Microsoft.Extensions.Configuration;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureApiScopes.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureApiScopes.cs
index 468c9700d72d31d3e90be8c0027c0ba883a03ae5..6ce7f0011e468bcd07f94ef54f695d2603398899 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureApiScopes.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureApiScopes.cs
@@ -1,7 +1,7 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-using IdentityServer4.Models;
+using Duende.IdentityServer.Models;
 using Microsoft.Extensions.Options;
 
 namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Configuration
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureClientScopes.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureClientScopes.cs
index 85650c64d3f91d70e74df6be6ec28cac65ec132c..6e374dd94d35eea7b9b7f3d976a99b19c49a1888 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureClientScopes.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureClientScopes.cs
@@ -3,7 +3,7 @@
 
 using System;
 using System.Linq;
-using IdentityServer4.Models;
+using Duende.IdentityServer.Models;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Options;
 
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureClients.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureClients.cs
index f242fdd9823cb3abfac97f0d6e4bbfbcdec2ce3f..b1dc5ae7488d5bc2320942a9852f78cf4c1cd88e 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureClients.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureClients.cs
@@ -3,7 +3,7 @@
 
 using System;
 using System.Collections.Generic;
-using IdentityServer4.Models;
+using Duende.IdentityServer.Models;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Options;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureIdentityResources.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureIdentityResources.cs
index 438efe385a0e9b1e1670cd3845b572dc5c50b7b0..f8622d20a6d8c7d51c9aa2adf8bde53adc71369f 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureIdentityResources.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Configuration/ConfigureIdentityResources.cs
@@ -34,31 +34,31 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
                 {
                     switch (scope)
                     {
-                        case IdentityServer4.IdentityServerConstants.StandardScopes.OpenId:
+                        case Duende.IdentityServer.IdentityServerConstants.StandardScopes.OpenId:
                             options.IdentityResources.Add(IdentityResourceBuilder.OpenId()
                                 .AllowAllClients()
                                 .FromConfiguration()
                                 .Build());
                             break;
-                        case IdentityServer4.IdentityServerConstants.StandardScopes.Profile:
+                        case Duende.IdentityServer.IdentityServerConstants.StandardScopes.Profile:
                             options.IdentityResources.Add(IdentityResourceBuilder.Profile()
                                 .AllowAllClients()
                                 .FromConfiguration()
                                 .Build());
                             break;
-                        case IdentityServer4.IdentityServerConstants.StandardScopes.Address:
+                        case Duende.IdentityServer.IdentityServerConstants.StandardScopes.Address:
                             options.IdentityResources.Add(IdentityResourceBuilder.Address()
                                 .AllowAllClients()
                                 .FromConfiguration()
                                 .Build());
                             break;
-                        case IdentityServer4.IdentityServerConstants.StandardScopes.Email:
+                        case Duende.IdentityServer.IdentityServerConstants.StandardScopes.Email:
                             options.IdentityResources.Add(IdentityResourceBuilder.Email()
                                 .AllowAllClients()
                                 .FromConfiguration()
                                 .Build());
                             break;
-                        case IdentityServer4.IdentityServerConstants.StandardScopes.Phone:
+                        case Duende.IdentityServer.IdentityServerConstants.StandardScopes.Phone:
                             options.IdentityResources.Add(IdentityResourceBuilder.Phone()
                                 .AllowAllClients()
                                 .FromConfiguration()
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Data/ApiAuthorizationDbContext.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Data/ApiAuthorizationDbContext.cs
index 464e6c4c989f2e431139fd9fe11e48479a11502a..07e66cca23346a41da5470b180d4aa8975421a34 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Data/ApiAuthorizationDbContext.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Data/ApiAuthorizationDbContext.cs
@@ -3,10 +3,10 @@
 
 using System;
 using System.Threading.Tasks;
-using IdentityServer4.EntityFramework.Entities;
-using IdentityServer4.EntityFramework.Extensions;
-using IdentityServer4.EntityFramework.Interfaces;
-using IdentityServer4.EntityFramework.Options;
+using Duende.IdentityServer.EntityFramework.Entities;
+using Duende.IdentityServer.EntityFramework.Extensions;
+using Duende.IdentityServer.EntityFramework.Interfaces;
+using Duende.IdentityServer.EntityFramework.Options;
 using Microsoft.AspNetCore.Identity;
 using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore;
@@ -45,6 +45,11 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
         /// </summary>
         public DbSet<DeviceFlowCodes> DeviceFlowCodes { get; set; }
 
+        /// <summary>
+        /// Gets or sets the <see cref="DbSet{Key}"/>.
+        /// </summary>
+        public DbSet<Key> Keys { get; set; }
+
         Task<int> IPersistedGrantDbContext.SaveChangesAsync() => base.SaveChangesAsync();
 
         /// <inheritdoc />
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Extensions/AutoRedirectEndSessionEndpoint.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Extensions/AutoRedirectEndSessionEndpoint.cs
index 8fd763004db1fc7f7f8f8e083aacde6dabb6e63f..bc20f7f308770b8ca5ce5bcb0033fef5d6b4e9d0 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Extensions/AutoRedirectEndSessionEndpoint.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Extensions/AutoRedirectEndSessionEndpoint.cs
@@ -5,12 +5,12 @@ using System;
 using System.Collections.Specialized;
 using System.Net;
 using System.Threading.Tasks;
-using IdentityServer4.Configuration;
-using IdentityServer4.Endpoints.Results;
-using IdentityServer4.Extensions;
-using IdentityServer4.Hosting;
-using IdentityServer4.Services;
-using IdentityServer4.Validation;
+using Duende.IdentityServer.Configuration;
+using Duende.IdentityServer.Endpoints.Results;
+using Duende.IdentityServer.Extensions;
+using Duende.IdentityServer.Hosting;
+using Duende.IdentityServer.Services;
+using Duende.IdentityServer.Validation;
 using Microsoft.AspNetCore.Authentication;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.WebUtilities;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Extensions/DefaultClientRequestParametersProvider.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Extensions/DefaultClientRequestParametersProvider.cs
index 793a6f9d77fb7d56ba705f6819da50f6a038a7f1..397fd4c67a955dd2d3b69261ec2fd4cb4bda194f 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Extensions/DefaultClientRequestParametersProvider.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Extensions/DefaultClientRequestParametersProvider.cs
@@ -1,7 +1,7 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-using IdentityServer4.Extensions;
+using Duende.IdentityServer.Extensions;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.Options;
 using System;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Extensions/RelativeRedirectUriValidator.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Extensions/RelativeRedirectUriValidator.cs
index 72a142f9348d5f97108669cc459b6fcb2b69ba86..83503b7398f507815096b0ad27d3ac9b1c02fa1f 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Extensions/RelativeRedirectUriValidator.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Extensions/RelativeRedirectUriValidator.cs
@@ -4,8 +4,8 @@
 using System;
 using System.Collections.Generic;
 using System.Threading.Tasks;
-using IdentityServer4.Models;
-using IdentityServer4.Validation;
+using Duende.IdentityServer.Models;
+using Duende.IdentityServer.Validation;
 
 namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
 {
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/IdentityServerBuilderConfigurationExtensions.cs b/src/Identity/ApiAuthorization.IdentityServer/src/IdentityServerBuilderConfigurationExtensions.cs
index bfb5d6d049f92d57eab45320af9007a102759452..e3761466b866d2bc92ead33b78e7923fbcedfd76 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/IdentityServerBuilderConfigurationExtensions.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/IdentityServerBuilderConfigurationExtensions.cs
@@ -4,12 +4,12 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using IdentityServer4.Configuration;
-using IdentityServer4.EntityFramework.Interfaces;
-using IdentityServer4.Hosting;
-using IdentityServer4.Models;
-using IdentityServer4.Stores;
-using IdentityServer4.Validation;
+using Duende.IdentityServer.Configuration;
+using Duende.IdentityServer.EntityFramework.Interfaces;
+using Duende.IdentityServer.Hosting;
+using Duende.IdentityServer.Models;
+using Duende.IdentityServer.Stores;
+using Duende.IdentityServer.Validation;
 using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
 using Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Configuration;
 using Microsoft.EntityFrameworkCore;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.csproj b/src/Identity/ApiAuthorization.IdentityServer/src/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.csproj
index 69a21f955ce33894eef0656585e886ef9a81fa83..8e2283e2c4806a4a54be7bf6373e9a5c4fd4a6d0 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.csproj
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.csproj
@@ -8,19 +8,27 @@
     <!-- We are a package that depends on the shared framework, this allows us to
          avoid errors during restore -->
     <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
+    <!-- IdentityServer packages are not strong named -->
+    <NoWarn>CS8002</NoWarn>
     <Nullable>disable</Nullable>
   </PropertyGroup>
 
   <ItemGroup>
-    <!-- Remove the reference to Microsoft.AspNetCore.App from IdentityServer4 -->
+    <!-- Remove the reference to Microsoft.AspNetCore.App from Duende.IdentityServer -->
     <FrameworkReference Remove="Microsoft.AspNetCore.App" />
-    <Reference Include="IdentityServer4.AspNetIdentity" />
-    <Reference Include="IdentityServer4.EntityFramework" />
-    <Reference Include="IdentityServer4.EntityFramework.Storage" />
-    <Reference Include="IdentityServer4" />
-    <Reference Include="IdentityServer4.Storage" />
+    <Reference Include="Duende.IdentityServer.AspNetIdentity" />
+    <Reference Include="Duende.IdentityServer.EntityFramework" />
+    <Reference Include="Duende.IdentityServer.EntityFramework.Storage" />
+    <Reference Include="Duende.IdentityServer" />
+    <Reference Include="Duende.IdentityServer.Storage" />
     <Reference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" />
     <Reference Include="Microsoft.AspNetCore.Identity.UI" />
+    <Reference Include="Newtonsoft.Json" />
+    <SuppressBaselineReference Include="IdentityServer4.AspNetIdentity" />
+    <SuppressBaselineReference Include="IdentityServer4.EntityFramework" />
+    <SuppressBaselineReference Include="IdentityServer4.EntityFramework.Storage" />
+    <SuppressBaselineReference Include="IdentityServer4" />
+    <SuppressBaselineReference Include="IdentityServer4.Storage" />
 
     <!-- These references don't matter as they'll be replaced by the shared framework reference -->
     <Reference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiResourceBuilder.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiResourceBuilder.cs
index bff201bcba1f7155a33bd5768b1d1c3e5414da84..8e79198e3ad185e76715680df509456c05242a2c 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiResourceBuilder.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiResourceBuilder.cs
@@ -3,7 +3,7 @@
 
 using System;
 using System.Linq;
-using IdentityServer4.Models;
+using Duende.IdentityServer.Models;
 
 namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
 {
@@ -112,7 +112,7 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
         /// <summary>
         /// Builds the API resource.
         /// </summary>
-        /// <returns>The built <see cref="IdentityServer4.Models.ApiResource"/>.</returns>
+        /// <returns>The built <see cref="Duende.IdentityServer.Models.ApiResource"/>.</returns>
         public ApiResource Build()
         {
             if (_built)
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiResourceCollection.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiResourceCollection.cs
index 104df03cbc05416cf1400eb79e3e0be3e2a68888..0b8ef366ac88ef6df391191000f474be95e825c5 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiResourceCollection.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiResourceCollection.cs
@@ -4,7 +4,7 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
-using IdentityServer4.Models;
+using Duende.IdentityServer.Models;
 
 namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
 {
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiScopeCollection.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiScopeCollection.cs
index 4ad0f2e62443b9f91d429f4366ad115541a9a7bb..2c3059c20fcdfe63ef751e4f887c1ffe3e3dd1ad 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiScopeCollection.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiScopeCollection.cs
@@ -4,7 +4,7 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
-using IdentityServer4.Models;
+using Duende.IdentityServer.Models;
 
 namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
 {
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ClientBuilder.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ClientBuilder.cs
index 2e66158f0d0821e32bd82a9c4a13ecda711550ff..9c22b90a54b48c34a00d129fef0e7a769a022a75 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ClientBuilder.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ClientBuilder.cs
@@ -3,8 +3,8 @@
 
 using System;
 using System.Collections.Generic;
-using IdentityServer4;
-using IdentityServer4.Models;
+using Duende.IdentityServer;
+using Duende.IdentityServer.Models;
 
 namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
 {
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ClientCollection.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ClientCollection.cs
index 9f3dd10e1d01951cf16affb6ca226f4ddaba1a81..c4ca12b58182da57c4fa22db85427f3e9768cf43 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ClientCollection.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ClientCollection.cs
@@ -1,7 +1,7 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-using IdentityServer4.Models;
+using Duende.IdentityServer.Models;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Options/IdentityResourceBuilder.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Options/IdentityResourceBuilder.cs
index 6a04a6640ee4439e415298c9d14d6b5b33d1ba5a..8bfabf654e000fce974b06a44249028c7aad97ac 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Options/IdentityResourceBuilder.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Options/IdentityResourceBuilder.cs
@@ -1,9 +1,9 @@
-// Copyright (c) .NET Foundation. All rights reserved.
+// Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 using System;
-using IdentityServer4;
-using IdentityServer4.Models;
+using Duende.IdentityServer;
+using Duende.IdentityServer.Models;
 
 namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
 {
@@ -74,7 +74,7 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
         /// <summary>
         /// Builds the API resource.
         /// </summary>
-        /// <returns>The built <see cref="IdentityServer4.Models.IdentityResource"/>.</returns>
+        /// <returns>The built <see cref="Duende.IdentityServer.Models.IdentityResource"/>.</returns>
         public IdentityResource Build()
         {
             if (_built)
@@ -129,4 +129,4 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer
             }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Options/IdentityResourceCollection.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Options/IdentityResourceCollection.cs
index e57358489c65a363751c9e334b60f79b085edec1..0e036d5c85fb580c1bb72f7ff81bd813175d3458 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/Options/IdentityResourceCollection.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/Options/IdentityResourceCollection.cs
@@ -1,7 +1,7 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-using IdentityServer4.Models;
+using Duende.IdentityServer.Models;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/PublicAPI.Unshipped.txt b/src/Identity/ApiAuthorization.IdentityServer/src/PublicAPI.Unshipped.txt
index 7dc5c58110bfa8486c4ddb75c89a99655c1adcf8..20b40db349279eeb112886474fd5137a424b0d52 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/src/PublicAPI.Unshipped.txt
+++ b/src/Identity/ApiAuthorization.IdentityServer/src/PublicAPI.Unshipped.txt
@@ -1 +1,52 @@
 #nullable enable
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext<TUser>.ApiAuthorizationDbContext(Microsoft.EntityFrameworkCore.DbContextOptions options, Microsoft.Extensions.Options.IOptions<IdentityServer4.EntityFramework.Options.OperationalStoreOptions> operationalStoreOptions) -> void
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext<TUser>.DeviceFlowCodes.get -> Microsoft.EntityFrameworkCore.DbSet<IdentityServer4.EntityFramework.Entities.DeviceFlowCodes>
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext<TUser>.PersistedGrants.get -> Microsoft.EntityFrameworkCore.DbSet<IdentityServer4.EntityFramework.Entities.PersistedGrant>
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiResourceBuilder.ApiResourceBuilder(IdentityServer4.Models.ApiResource resource) -> void
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiResourceBuilder.Build() -> IdentityServer4.Models.ApiResource
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiResourceCollection.AddRange(params IdentityServer4.Models.ApiResource[] resources) -> void
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiResourceCollection.ApiResourceCollection(System.Collections.Generic.IList<IdentityServer4.Models.ApiResource> list) -> void
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiResourceCollection.this[string key].get -> IdentityServer4.Models.ApiResource
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiScopeCollection.AddRange(params IdentityServer4.Models.ApiScope[] scopes) -> void
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiScopeCollection.ApiScopeCollection(System.Collections.Generic.IList<IdentityServer4.Models.ApiScope> list) -> void
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiScopeCollection.this[string key].get -> IdentityServer4.Models.ApiScope
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientBuilder.Build() -> IdentityServer4.Models.Client
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientBuilder.ClientBuilder(IdentityServer4.Models.Client client) -> void
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.AddIdentityServerSPA(string clientId, System.Action<Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientBuilder> configure) -> IdentityServer4.Models.Client
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.AddNativeApp(string clientId, System.Action<Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientBuilder> configure) -> IdentityServer4.Models.Client
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.AddRange(params IdentityServer4.Models.Client[] clients) -> void
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.AddSPA(string clientId, System.Action<Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientBuilder> configure) -> IdentityServer4.Models.Client
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.ClientCollection(System.Collections.Generic.IList<IdentityServer4.Models.Client> list) -> void
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.this[string key].get -> IdentityServer4.Models.Client
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.IdentityResourceBuilder.Build() -> IdentityServer4.Models.IdentityResource
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.IdentityResourceBuilder.IdentityResourceBuilder(IdentityServer4.Models.IdentityResource resource) -> void
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.IdentityResourceCollection.AddRange(params IdentityServer4.Models.IdentityResource[] identityResources) -> void
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.IdentityResourceCollection.IdentityResourceCollection(System.Collections.Generic.IList<IdentityServer4.Models.IdentityResource> list) -> void
+*REMOVED*~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.IdentityResourceCollection.this[string key].get -> IdentityServer4.Models.IdentityResource
+*REMOVED*~static Microsoft.Extensions.DependencyInjection.IdentityServerBuilderConfigurationExtensions.AddSigningCredentials(this Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder builder, Microsoft.Extensions.Configuration.IConfiguration configuration) -> Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext<TUser>.ApiAuthorizationDbContext(Microsoft.EntityFrameworkCore.DbContextOptions options, Microsoft.Extensions.Options.IOptions<Duende.IdentityServer.EntityFramework.Options.OperationalStoreOptions> operationalStoreOptions) -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext<TUser>.DeviceFlowCodes.get -> Microsoft.EntityFrameworkCore.DbSet<Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes>
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext<TUser>.Keys.get -> Microsoft.EntityFrameworkCore.DbSet<Duende.IdentityServer.EntityFramework.Entities.Key>
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext<TUser>.Keys.set -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext<TUser>.PersistedGrants.get -> Microsoft.EntityFrameworkCore.DbSet<Duende.IdentityServer.EntityFramework.Entities.PersistedGrant>
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiResourceBuilder.ApiResourceBuilder(Duende.IdentityServer.Models.ApiResource resource) -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiResourceBuilder.Build() -> Duende.IdentityServer.Models.ApiResource
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiResourceCollection.AddRange(params Duende.IdentityServer.Models.ApiResource[] resources) -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiResourceCollection.ApiResourceCollection(System.Collections.Generic.IList<Duende.IdentityServer.Models.ApiResource> list) -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiResourceCollection.this[string key].get -> Duende.IdentityServer.Models.ApiResource
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiScopeCollection.AddRange(params Duende.IdentityServer.Models.ApiScope[] scopes) -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiScopeCollection.ApiScopeCollection(System.Collections.Generic.IList<Duende.IdentityServer.Models.ApiScope> list) -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiScopeCollection.this[string key].get -> Duende.IdentityServer.Models.ApiScope
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientBuilder.Build() -> Duende.IdentityServer.Models.Client
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientBuilder.ClientBuilder(Duende.IdentityServer.Models.Client client) -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.AddIdentityServerSPA(string clientId, System.Action<Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientBuilder> configure) -> Duende.IdentityServer.Models.Client
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.AddNativeApp(string clientId, System.Action<Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientBuilder> configure) -> Duende.IdentityServer.Models.Client
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.AddRange(params Duende.IdentityServer.Models.Client[] clients) -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.AddSPA(string clientId, System.Action<Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientBuilder> configure) -> Duende.IdentityServer.Models.Client
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.ClientCollection(System.Collections.Generic.IList<Duende.IdentityServer.Models.Client> list) -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.this[string key].get -> Duende.IdentityServer.Models.Client
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.IdentityResourceBuilder.Build() -> Duende.IdentityServer.Models.IdentityResource
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.IdentityResourceBuilder.IdentityResourceBuilder(Duende.IdentityServer.Models.IdentityResource resource) -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.IdentityResourceCollection.AddRange(params Duende.IdentityServer.Models.IdentityResource[] identityResources) -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.IdentityResourceCollection.IdentityResourceCollection(System.Collections.Generic.IList<Duende.IdentityServer.Models.IdentityResource> list) -> void
+~Microsoft.AspNetCore.ApiAuthorization.IdentityServer.IdentityResourceCollection.this[string key].get -> Duende.IdentityServer.Models.IdentityResource
diff --git a/src/Identity/ApiAuthorization.IdentityServer/test/Authentication/LocalApiJwtBearerConfigurationTest.cs b/src/Identity/ApiAuthorization.IdentityServer/test/Authentication/LocalApiJwtBearerConfigurationTest.cs
index 1d6dc35261cc3362df84c3b2d66b7edbfd3e059b..6414d4ef0d66887c5123894226d1c3a3337cbc0b 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/test/Authentication/LocalApiJwtBearerConfigurationTest.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/test/Authentication/LocalApiJwtBearerConfigurationTest.cs
@@ -4,8 +4,8 @@
 using System.Collections.Generic;
 using System.Security.Cryptography;
 using System.Threading.Tasks;
-using IdentityServer4.Configuration;
-using IdentityServer4.Stores;
+using Duende.IdentityServer.Configuration;
+using Duende.IdentityServer.Stores;
 using Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Configuration;
 using Microsoft.AspNetCore.Authentication;
 using Microsoft.AspNetCore.Authentication.JwtBearer;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/AspNetConventionsConfigureOptionsTests.cs b/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/AspNetConventionsConfigureOptionsTests.cs
index 8a1eecb5cd0cbbc9ac2516c649824bac8d70c57f..36efeb20d17ac34f3269a047c3fe079c8eb02ae8 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/AspNetConventionsConfigureOptionsTests.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/AspNetConventionsConfigureOptionsTests.cs
@@ -1,7 +1,7 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-using IdentityServer4.Configuration;
+using Duende.IdentityServer.Configuration;
 using Microsoft.AspNetCore.Identity;
 using Xunit;
 
diff --git a/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/ConfigureClientsTests.cs b/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/ConfigureClientsTests.cs
index 42f1fcc2d06f25eddd9b4a9b655da0967b6ff7eb..c5d2c6d13523cafc59e8564c2c5a16e848f1e31f 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/ConfigureClientsTests.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/ConfigureClientsTests.cs
@@ -1,8 +1,8 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-using IdentityServer4;
-using IdentityServer4.Models;
+using Duende.IdentityServer;
+using Duende.IdentityServer.Models;
 using Microsoft.Extensions.Configuration;
 using System;
 using System.Collections.Generic;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/AutoRedirectEndSessionEndpointTests.cs b/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/AutoRedirectEndSessionEndpointTests.cs
index 389e836217878d3d5977c89e916f0508b515349f..a777a39f651043c3f52c0610c9dd50236a6cc20d 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/AutoRedirectEndSessionEndpointTests.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/AutoRedirectEndSessionEndpointTests.cs
@@ -5,11 +5,11 @@ using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Security.Claims;
 using System.Threading.Tasks;
-using IdentityServer4.Configuration;
-using IdentityServer4.Endpoints.Results;
-using IdentityServer4.Models;
-using IdentityServer4.Services;
-using IdentityServer4.Validation;
+using Duende.IdentityServer.Configuration;
+using Duende.IdentityServer.Endpoints.Results;
+using Duende.IdentityServer.Models;
+using Duende.IdentityServer.Services;
+using Duende.IdentityServer.Validation;
 using Microsoft.AspNetCore.Authentication;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Identity;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/DefaultClientRequestParametersProviderTests.cs b/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/DefaultClientRequestParametersProviderTests.cs
index 308c17160147359fe1362736df14e32cd9ab4500..f16176e11600e966d8a0b3025012d51a426bc356 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/DefaultClientRequestParametersProviderTests.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/DefaultClientRequestParametersProviderTests.cs
@@ -3,7 +3,7 @@
 
 using System;
 using System.Collections.Generic;
-using IdentityServer4.Configuration;
+using Duende.IdentityServer.Configuration;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Options;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/IdentityServerBuilderConfigurationExtensionsTests.cs b/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/IdentityServerBuilderConfigurationExtensionsTests.cs
index 440536272f9e37d5fb70d833263cbbd415621b6e..31c02a466a3bb4eb66effd07bd8e2769cbb7a41d 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/IdentityServerBuilderConfigurationExtensionsTests.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/IdentityServerBuilderConfigurationExtensionsTests.cs
@@ -4,9 +4,9 @@
 using System;
 using System.Collections.Generic;
 using System.Threading.Tasks;
-using IdentityServer4.EntityFramework.Entities;
-using IdentityServer4.EntityFramework.Interfaces;
-using IdentityServer4.Stores;
+using Duende.IdentityServer.EntityFramework.Entities;
+using Duende.IdentityServer.EntityFramework.Interfaces;
+using Duende.IdentityServer.Stores;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Testing;
 using Microsoft.EntityFrameworkCore;
@@ -109,6 +109,8 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Extensions
 
             public DbSet<DeviceFlowCodes> DeviceFlowCodes { get; set; }
 
+            public DbSet<Key> Keys { get; set; }
+
             public Task<int> SaveChangesAsync()
             {
                 throw new NotImplementedException();
diff --git a/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/RelativeRedirectUriValidatorTests.cs b/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/RelativeRedirectUriValidatorTests.cs
index f067b2c65e3656d39204aeaad1f141f957782ffd..d427d712c1e279af3eedb660aa5afc1831cf0511 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/RelativeRedirectUriValidatorTests.cs
+++ b/src/Identity/ApiAuthorization.IdentityServer/test/Extensions/RelativeRedirectUriValidatorTests.cs
@@ -1,7 +1,7 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-using IdentityServer4.Models;
+using Duende.IdentityServer.Models;
 using Microsoft.AspNetCore.Http;
 using System.Collections.Generic;
 using System.Threading.Tasks;
diff --git a/src/Identity/ApiAuthorization.IdentityServer/test/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Tests.csproj b/src/Identity/ApiAuthorization.IdentityServer/test/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Tests.csproj
index 8b291f49797b03f0c06a073616984f4b449be7f9..68c2b18fc1b5ce96e98ea94e2924f1f389650c12 100644
--- a/src/Identity/ApiAuthorization.IdentityServer/test/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Tests.csproj
+++ b/src/Identity/ApiAuthorization.IdentityServer/test/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Tests.csproj
@@ -5,10 +5,12 @@
     <!-- We are a package that depends on the shared framework, this allows us to
          avoid errors during restore -->
     <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
+    <!-- IdentityServer packages are not strong named -->
+    <NoWarn>CS8002</NoWarn>
   </PropertyGroup>
 
   <ItemGroup>
-      <!-- Remove the reference to Microsoft.AspNetCore.App from IdentityServer4 -->
+      <!-- Remove the reference to Microsoft.AspNetCore.App from Duende.IdentityServer -->
     <FrameworkReference Remove="Microsoft.AspNetCore.App" />
 
     <Reference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" />
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/ApplicationDbContext.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/ApplicationDbContext.cs
index 39ef8cb3a4e74c70d6e0b574c3b5d10f94606bf3..0169288a585e0c9f4eb968582ce6326093a70abd 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/ApplicationDbContext.cs
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/ApplicationDbContext.cs
@@ -1,7 +1,7 @@
 using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.Options;
-using IdentityServer4.EntityFramework.Options;
+using Duende.IdentityServer.EntityFramework.Options;
 using ComponentsWebAssembly_CSharp.Server.Models;
 
 namespace ComponentsWebAssembly_CSharp.Server.Data;
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlLite/00000000000000_CreateIdentitySchema.Designer.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlLite/00000000000000_CreateIdentitySchema.Designer.cs
index 23df6673d35e504c23591945198dc3d6e4269a26..56adafe29cb82d5bfde23e933ffa943a10ec7f3f 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlLite/00000000000000_CreateIdentitySchema.Designer.cs
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlLite/00000000000000_CreateIdentitySchema.Designer.cs
@@ -82,7 +82,7 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
                     b.ToTable("AspNetUsers");
                 });
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b =>
                 {
                     b.Property<string>("UserCode")
                         .HasMaxLength(200)
@@ -132,7 +132,45 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
                     b.ToTable("DeviceCodes");
                 });
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b =>
+                {
+                    b.Property<string>("Id")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Algorithm")
+                        .IsRequired()
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("Created")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Data")
+                        .IsRequired()
+                        .HasMaxLength(50000)
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("DataProtected")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool>("IsX509Certificate")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Use")
+                        .HasMaxLength(450)
+                        .HasColumnType("TEXT");
+
+                    b.Property<int>("Version")
+                        .HasColumnType("INTEGER");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Use");
+
+                    b.ToTable("Keys");
+                });
+
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b =>
                 {
                     b.Property<string>("Key")
                         .HasMaxLength(200)
@@ -176,6 +214,8 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
 
                     b.HasKey("Key");
 
+                    b.HasIndex("ConsumedTime");
+
                     b.HasIndex("Expiration");
 
                     b.HasIndex("SubjectId", "ClientId", "Type");
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlLite/00000000000000_CreateIdentitySchema.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlLite/00000000000000_CreateIdentitySchema.cs
index 25d42c8dae46a98535ba1efb48706e2aa18e0066..a2f96bf24008369bb7fe6e7fa983c1f80ffd964d 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlLite/00000000000000_CreateIdentitySchema.cs
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlLite/00000000000000_CreateIdentitySchema.cs
@@ -65,6 +65,24 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
                     table.PrimaryKey("PK_DeviceCodes", x => x.UserCode);
                 });
 
+            migrationBuilder.CreateTable(
+                name: "Keys",
+                columns: table => new
+                {
+                    Id = table.Column<string>(type: "TEXT", nullable: false),
+                    Version = table.Column<int>(type: "INTEGER", nullable: false),
+                    Created = table.Column<DateTime>(type: "TEXT", nullable: false),
+                    Use = table.Column<string>(type: "TEXT", maxLength: 450, nullable: true),
+                    Algorithm = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
+                    IsX509Certificate = table.Column<bool>(type: "INTEGER", nullable: false),
+                    DataProtected = table.Column<bool>(type: "INTEGER", nullable: false),
+                    Data = table.Column<string>(type: "TEXT", maxLength: 50000, nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Keys", x => x.Id);
+                });
+
             migrationBuilder.CreateTable(
                 name: "PersistedGrants",
                 columns: table => new
@@ -239,6 +257,16 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
                 table: "DeviceCodes",
                 column: "Expiration");
 
+            migrationBuilder.CreateIndex(
+                name: "IX_Keys_Use",
+                table: "Keys",
+                column: "Use");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_PersistedGrants_ConsumedTime",
+                table: "PersistedGrants",
+                column: "ConsumedTime");
+
             migrationBuilder.CreateIndex(
                 name: "IX_PersistedGrants_Expiration",
                 table: "PersistedGrants",
@@ -275,6 +303,9 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
             migrationBuilder.DropTable(
                 name: "DeviceCodes");
 
+            migrationBuilder.DropTable(
+                name: "Keys");
+
             migrationBuilder.DropTable(
                 name: "PersistedGrants");
 
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlLite/ApplicationDbContextModelSnapshot.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlLite/ApplicationDbContextModelSnapshot.cs
index 3c3c91a357fafded512a3e43c16bb6b65b245326..53f211899d35ff2246e45522b61b85bb1742238d 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlLite/ApplicationDbContextModelSnapshot.cs
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlLite/ApplicationDbContextModelSnapshot.cs
@@ -80,7 +80,7 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
                     b.ToTable("AspNetUsers");
                 });
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b =>
                 {
                     b.Property<string>("UserCode")
                         .HasMaxLength(200)
@@ -130,7 +130,45 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
                     b.ToTable("DeviceCodes");
                 });
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b =>
+                {
+                    b.Property<string>("Id")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Algorithm")
+                        .IsRequired()
+                        .HasMaxLength(100)
+                        .HasColumnType("TEXT");
+
+                    b.Property<DateTime>("Created")
+                        .HasColumnType("TEXT");
+
+                    b.Property<string>("Data")
+                        .IsRequired()
+                        .HasMaxLength(50000)
+                        .HasColumnType("TEXT");
+
+                    b.Property<bool>("DataProtected")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<bool>("IsX509Certificate")
+                        .HasColumnType("INTEGER");
+
+                    b.Property<string>("Use")
+                        .HasMaxLength(450)
+                        .HasColumnType("TEXT");
+
+                    b.Property<int>("Version")
+                        .HasColumnType("INTEGER");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Use");
+
+                    b.ToTable("Keys");
+                });
+
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b =>
                 {
                     b.Property<string>("Key")
                         .HasMaxLength(200)
@@ -174,6 +212,8 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
 
                     b.HasKey("Key");
 
+                    b.HasIndex("ConsumedTime");
+
                     b.HasIndex("Expiration");
 
                     b.HasIndex("SubjectId", "ClientId", "Type");
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlServer/00000000000000_CreateIdentitySchema.Designer.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlServer/00000000000000_CreateIdentitySchema.Designer.cs
index 072bc519965e5081d5637fd3ea8be0355df7f88d..efa118bae843943956688c2204c3a41c8eedc3c2 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlServer/00000000000000_CreateIdentitySchema.Designer.cs
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlServer/00000000000000_CreateIdentitySchema.Designer.cs
@@ -86,7 +86,7 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
                     b.ToTable("AspNetUsers");
                 });
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b =>
                 {
                     b.Property<string>("UserCode")
                         .HasMaxLength(200)
@@ -136,7 +136,46 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
                     b.ToTable("DeviceCodes");
                 });
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b =>
+                {
+                    b.Property<string>("Id")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)");
+
+                    b.Property<string>("Algorithm")
+                        .IsRequired()
+                        .HasMaxLength(100)
+                        .HasColumnType("nvarchar(100)");
+
+                    b.Property<DateTime>("Created")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("Data")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)")
+                        .HasMaxLength(50000);
+                        
+                    b.Property<bool>("DataProtected")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("IsX509Certificate")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("Use")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)");
+
+                    b.Property<int>("Version")
+                        .HasColumnType("int");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Use");
+
+                    b.ToTable("Keys");
+                });
+
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b =>
                 {
                     b.Property<string>("Key")
                         .HasMaxLength(200)
@@ -180,6 +219,8 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
 
                     b.HasKey("Key");
 
+                    b.HasIndex("ConsumedTime");
+
                     b.HasIndex("Expiration");
 
                     b.HasIndex("SubjectId", "ClientId", "Type");
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlServer/00000000000000_CreateIdentitySchema.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlServer/00000000000000_CreateIdentitySchema.cs
index 84ba4d1e07300260b792bf2fdd079a30acc46b1d..915296bf392703f332771766dc360f02f0a6d2c4 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlServer/00000000000000_CreateIdentitySchema.cs
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlServer/00000000000000_CreateIdentitySchema.cs
@@ -65,6 +65,24 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
                     table.PrimaryKey("PK_DeviceCodes", x => x.UserCode);
                 });
 
+            migrationBuilder.CreateTable(
+                name: "Keys",
+                columns: table => new
+                {
+                    Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
+                    Version = table.Column<int>(type: "int", nullable: false),
+                    Created = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    Use = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    Algorithm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
+                    IsX509Certificate = table.Column<bool>(type: "bit", nullable: false),
+                    DataProtected = table.Column<bool>(type: "bit", nullable: false),
+                    Data = table.Column<string>(type: "nvarchar(max)", maxLength: 50000, nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Keys", x => x.Id);
+                });
+
             migrationBuilder.CreateTable(
                 name: "PersistedGrants",
                 columns: table => new
@@ -241,6 +259,16 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
                 table: "DeviceCodes",
                 column: "Expiration");
 
+            migrationBuilder.CreateIndex(
+                name: "IX_Keys_Use",
+                table: "Keys",
+                column: "Use");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_PersistedGrants_ConsumedTime",
+                table: "PersistedGrants",
+                column: "ConsumedTime");
+
             migrationBuilder.CreateIndex(
                 name: "IX_PersistedGrants_Expiration",
                 table: "PersistedGrants",
@@ -277,6 +305,9 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
             migrationBuilder.DropTable(
                 name: "DeviceCodes");
 
+            migrationBuilder.DropTable(
+                name: "Keys");
+
             migrationBuilder.DropTable(
                 name: "PersistedGrants");
 
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlServer/ApplicationDbContextModelSnapshot.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlServer/ApplicationDbContextModelSnapshot.cs
index c751e16729b86b3fe4888dec03e1f28c35d09692..9eea2ae4bd8bf7a9ce6936680d95de2f657a1508 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlServer/ApplicationDbContextModelSnapshot.cs
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/SqlServer/ApplicationDbContextModelSnapshot.cs
@@ -84,7 +84,7 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
                     b.ToTable("AspNetUsers");
                 });
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b =>
                 {
                     b.Property<string>("UserCode")
                         .HasMaxLength(200)
@@ -134,7 +134,46 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
                     b.ToTable("DeviceCodes");
                 });
 
-            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b =>
+                {
+                    b.Property<string>("Id")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)");
+
+                    b.Property<string>("Algorithm")
+                        .IsRequired()
+                        .HasMaxLength(100)
+                        .HasColumnType("nvarchar(100)");
+
+                    b.Property<DateTime>("Created")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("Data")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)")
+                        .HasMaxLength(50000);
+                        
+                    b.Property<bool>("DataProtected")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("IsX509Certificate")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("Use")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)");
+
+                    b.Property<int>("Version")
+                        .HasColumnType("int");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("Use");
+
+                    b.ToTable("Keys");
+                });
+
+            modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b =>
                 {
                     b.Property<string>("Key")
                         .HasMaxLength(200)
@@ -178,6 +217,8 @@ namespace ComponentsWebAssembly_CSharp.Server.Data.Migrations
 
                     b.HasKey("Key");
 
+                    b.HasIndex("ConsumedTime");
+
                     b.HasIndex("Expiration");
 
                     b.HasIndex("SubjectId", "ClientId", "Type");