diff --git a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityClientConfiguration.cs b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityClientConfiguration.cs index 325491685b..8faf3225ab 100644 --- a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityClientConfiguration.cs +++ b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityClientConfiguration.cs @@ -83,6 +83,24 @@ public class IdentityClientConfiguration : Dictionary get => this.GetOrDefault(nameof(CacheAbsoluteExpiration))?.To() ?? 60 * 30; set => this[nameof(CacheAbsoluteExpiration)] = value.ToString(CultureInfo.InvariantCulture); } + + /// + /// ValidateIssuerName. + /// Default: true. + /// + public bool ValidateIssuerName { + get => this.GetOrDefault(nameof(ValidateIssuerName))?.To() ?? true; + set => this[nameof(ValidateIssuerName)] = value.ToString().ToLowerInvariant(); + } + + /// + /// ValidateEndpoints. + /// Default: true. + /// + public bool ValidateEndpoints { + get => this.GetOrDefault(nameof(ValidateEndpoints))?.To() ?? true; + set => this[nameof(ValidateEndpoints)] = value.ToString().ToLowerInvariant(); + } public IdentityClientConfiguration() { @@ -98,7 +116,9 @@ public class IdentityClientConfiguration : Dictionary string userName = null, string userPassword = null, bool requireHttps = true, - int cacheAbsoluteExpiration = 60 * 30) + int cacheAbsoluteExpiration = 60 * 30, + bool validateIssuerName = true, + bool validateEndpoints = true) { this[nameof(Authority)] = authority; this[nameof(Scope)] = scope; @@ -109,5 +129,7 @@ public class IdentityClientConfiguration : Dictionary this[nameof(UserPassword)] = userPassword; this[nameof(RequireHttps)] = requireHttps.ToString().ToLowerInvariant(); this[nameof(CacheAbsoluteExpiration)] = cacheAbsoluteExpiration.ToString(CultureInfo.InvariantCulture); + this[nameof(ValidateIssuerName)] = validateIssuerName.ToString().ToLowerInvariant(); + this[nameof(ValidateEndpoints)] = validateEndpoints.ToString().ToLowerInvariant(); } } diff --git a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs index 6e98a047bb..db59346465 100644 --- a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs +++ b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs @@ -127,7 +127,9 @@ public class IdentityModelAuthenticationService : IIdentityModelAuthenticationSe Address = configuration.Authority, Policy = { - RequireHttps = configuration.RequireHttps + RequireHttps = configuration.RequireHttps, + ValidateIssuerName = configuration.ValidateIssuerName, + ValidateEndpoints = configuration.ValidateEndpoints } }; IdentityModelHttpRequestMessageOptions.ConfigureHttpRequestMessage?.Invoke(request);