diff --git a/src/EntityFramework.Storage/Entities/Client.cs b/src/EntityFramework.Storage/Entities/Client.cs index 7e220502c..cb91a150c 100644 --- a/src/EntityFramework.Storage/Entities/Client.cs +++ b/src/EntityFramework.Storage/Entities/Client.cs @@ -51,7 +51,7 @@ public class Client public int RefreshTokenUsage { get; set; } = (int)TokenUsage.OneTimeOnly; public bool UpdateAccessTokenClaimsOnRefresh { get; set; } public int RefreshTokenExpiration { get; set; } = (int)TokenExpiration.Absolute; - public int AccessTokenType { get; set; } = (int)0; // AccessTokenType.Jwt; + public int AccessTokenType { get; set; } = 0; // AccessTokenType.Jwt; public bool EnableLocalLogin { get; set; } = true; public List IdentityProviderRestrictions { get; set; } public bool IncludeJwtId { get; set; } diff --git a/src/EntityFramework.Storage/Extensions/ModelBuilderExtensions.cs b/src/EntityFramework.Storage/Extensions/ModelBuilderExtensions.cs index 6a9d17a9e..cef4836d2 100644 --- a/src/EntityFramework.Storage/Extensions/ModelBuilderExtensions.cs +++ b/src/EntityFramework.Storage/Extensions/ModelBuilderExtensions.cs @@ -163,7 +163,7 @@ public static void ConfigurePersistedGrantContext(this ModelBuilder modelBuilder grant.Property(x => x.Data).HasMaxLength(50000).IsRequired(); grant.HasKey(x => x.Id); - + grant.HasIndex(x => x.Key).IsUnique(); grant.HasIndex(x => new { x.SubjectId, x.ClientId, x.Type }); grant.HasIndex(x => new { x.SubjectId, x.SessionId, x.Type }); @@ -310,18 +310,18 @@ public static void ConfigureResourcesContext(this ModelBuilder modelBuilder, Con apiClaim.ToTable(storeOptions.ApiResourceClaim).HasKey(x => x.Id); apiClaim.Property(x => x.Type).HasMaxLength(200).IsRequired(); - + apiClaim.HasIndex(x => new { x.ApiResourceId, x.Type }).IsUnique(); }); - modelBuilder.Entity((System.Action>)(apiScope => + modelBuilder.Entity(apiScope => { - apiScope.ToTable((TableConfiguration)storeOptions.ApiResourceScope).HasKey(x => x.Id); + apiScope.ToTable(storeOptions.ApiResourceScope).HasKey(x => x.Id); apiScope.Property(x => x.Scope).HasMaxLength(200).IsRequired(); - + apiScope.HasIndex(x => new { x.ApiResourceId, x.Scope }).IsUnique(); - })); + }); modelBuilder.Entity(property => { @@ -332,7 +332,6 @@ public static void ConfigureResourcesContext(this ModelBuilder modelBuilder, Con property.HasIndex(x => new { x.ApiResourceId, x.Key }).IsUnique(); }); - modelBuilder.Entity(scope => { scope.ToTable(storeOptions.ApiScope).HasKey(x => x.Id); diff --git a/src/IdentityServer/Services/Default/KeyManagement/KeyManager.cs b/src/IdentityServer/Services/Default/KeyManagement/KeyManager.cs index b96157dc0..1314811fd 100644 --- a/src/IdentityServer/Services/Default/KeyManagement/KeyManager.cs +++ b/src/IdentityServer/Services/Default/KeyManagement/KeyManager.cs @@ -277,17 +277,17 @@ internal async Task CreateAndStoreNewKeyAsync(SigningAlgorithmOpti if (alg.IsRsaKey) { var rsa = CryptoHelper.CreateRsaSecurityKey(_options.KeyManagement.RsaKeySize); - + container = alg.UseX509Certificate ? new X509KeyContainer(rsa, alg.Name, now, _options.KeyManagement.KeyRetirementAge, iss) : - (KeyContainer)new RsaKeyContainer(rsa, alg.Name, now); + new RsaKeyContainer(rsa, alg.Name, now); } else if (alg.IsEcKey) { var ec = CryptoHelper.CreateECDsaSecurityKey(CryptoHelper.GetCurveNameFromSigningAlgorithm(alg.Name)); // X509 certs don't currently work with EC keys. container = //_options.KeyManagement.WrapKeysInX509Certificate ? //new X509KeyContainer(ec, alg, now, _options.KeyManagement.KeyRetirementAge, iss) : - (KeyContainer) new EcKeyContainer(ec, alg.Name, now); + new EcKeyContainer(ec, alg.Name, now); } else {