diff --git a/src/Microsoft.IdentityModel.Protocols.OpenIdConnect/Configuration/OpenIdConnectConfiguration.cs b/src/Microsoft.IdentityModel.Protocols.OpenIdConnect/Configuration/OpenIdConnectConfiguration.cs index 6ff1c65483..eafbbb1342 100644 --- a/src/Microsoft.IdentityModel.Protocols.OpenIdConnect/Configuration/OpenIdConnectConfiguration.cs +++ b/src/Microsoft.IdentityModel.Protocols.OpenIdConnect/Configuration/OpenIdConnectConfiguration.cs @@ -23,41 +23,41 @@ public class OpenIdConnectConfiguration : BaseConfiguration // these are used to lazy create private Dictionary _additionalData; - private ICollection _acrValuesSupported; - private ICollection _authorizationDetailsTypesSupported; - private ICollection _authorizationEncryptionAlgValuesSupported; - private ICollection _authorizationEncryptionEncValuesSupported; - private ICollection _authorizationSigningAlgValuesSupported; - private ICollection _backchannelAuthenticationRequestSigningAlgValuesSupported; - private ICollection _backchannelTokenDeliveryModesSupported; - private ICollection _claimsSupported; - private ICollection _claimsLocalesSupported; - private ICollection _claimTypesSupported; - private ICollection _codeChallengeMethodsSupported; - private ICollection _displayValuesSupported; - private ICollection _dPoPSigningAlgValuesSupported; - private ICollection _grantTypesSupported; - private ICollection _idTokenEncryptionAlgValuesSupported; - private ICollection _idTokenEncryptionEncValuesSupported; - private ICollection _idTokenSigningAlgValuesSupported; - private ICollection _introspectionEndpointAuthMethodsSupported; - private ICollection _introspectionEndpointAuthSigningAlgValuesSupported; - private ICollection _promptValuesSupported; - private ICollection _requestObjectEncryptionAlgValuesSupported; - private ICollection _requestObjectEncryptionEncValuesSupported; - private ICollection _requestObjectSigningAlgValuesSupported; - private ICollection _responseModesSupported; - private ICollection _responseTypesSupported; - private ICollection _revocationEndpointAuthMethodsSupported; - private ICollection _revocationEndpointAuthSigningAlgValuesSupported; - private ICollection _scopesSupported; - private ICollection _subjectTypesSupported; - private ICollection _tokenEndpointAuthMethodsSupported; - private ICollection _tokenEndpointAuthSigningAlgValuesSupported; - private ICollection _uILocalesSupported; - private ICollection _userInfoEndpointEncryptionAlgValuesSupported; - private ICollection _userInfoEndpointEncryptionEncValuesSupported; - private ICollection _userInfoEndpointSigningAlgValuesSupported; + private HashSet _acrValuesSupported; + private HashSet _authorizationDetailsTypesSupported; + private HashSet _authorizationEncryptionAlgValuesSupported; + private HashSet _authorizationEncryptionEncValuesSupported; + private HashSet _authorizationSigningAlgValuesSupported; + private HashSet _backchannelAuthenticationRequestSigningAlgValuesSupported; + private HashSet _backchannelTokenDeliveryModesSupported; + private HashSet _claimsSupported; + private HashSet _claimsLocalesSupported; + private HashSet _claimTypesSupported; + private HashSet _codeChallengeMethodsSupported; + private HashSet _displayValuesSupported; + private HashSet _dPoPSigningAlgValuesSupported; + private HashSet _grantTypesSupported; + private HashSet _idTokenEncryptionAlgValuesSupported; + private HashSet _idTokenEncryptionEncValuesSupported; + private HashSet _idTokenSigningAlgValuesSupported; + private HashSet _introspectionEndpointAuthMethodsSupported; + private HashSet _introspectionEndpointAuthSigningAlgValuesSupported; + private HashSet _promptValuesSupported; + private HashSet _requestObjectEncryptionAlgValuesSupported; + private HashSet _requestObjectEncryptionEncValuesSupported; + private HashSet _requestObjectSigningAlgValuesSupported; + private HashSet _responseModesSupported; + private HashSet _responseTypesSupported; + private HashSet _revocationEndpointAuthMethodsSupported; + private HashSet _revocationEndpointAuthSigningAlgValuesSupported; + private HashSet _scopesSupported; + private HashSet _subjectTypesSupported; + private HashSet _tokenEndpointAuthMethodsSupported; + private HashSet _tokenEndpointAuthSigningAlgValuesSupported; + private HashSet _uILocalesSupported; + private HashSet _userInfoEndpointEncryptionAlgValuesSupported; + private HashSet _userInfoEndpointEncryptionEncValuesSupported; + private HashSet _userInfoEndpointSigningAlgValuesSupported; /// /// Deserializes the json string into an object. @@ -160,7 +160,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.AcrValuesSupported)] public ICollection AcrValuesSupported => _acrValuesSupported ?? - Interlocked.CompareExchange(ref _acrValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _acrValuesSupported, new HashSet(), null) ?? _acrValuesSupported; /// @@ -169,7 +169,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.AuthorizationDetailsTypesSupported)] public ICollection AuthorizationDetailsTypesSupported => _authorizationDetailsTypesSupported ?? - Interlocked.CompareExchange(ref _authorizationDetailsTypesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _authorizationDetailsTypesSupported, new HashSet(), null) ?? _authorizationDetailsTypesSupported; /// @@ -187,7 +187,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.AuthorizationEncryptionAlgValuesSupported)] public ICollection AuthorizationEncryptionAlgValuesSupported => _authorizationEncryptionAlgValuesSupported ?? - Interlocked.CompareExchange(ref _authorizationEncryptionAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _authorizationEncryptionAlgValuesSupported, new HashSet(), null) ?? _authorizationEncryptionAlgValuesSupported; /// @@ -196,7 +196,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.AuthorizationEncryptionEncValuesSupported)] public ICollection AuthorizationEncryptionEncValuesSupported => _authorizationEncryptionEncValuesSupported ?? - Interlocked.CompareExchange(ref _authorizationEncryptionEncValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _authorizationEncryptionEncValuesSupported, new HashSet(), null) ?? _authorizationEncryptionEncValuesSupported; /// @@ -214,7 +214,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.AuthorizationSigningAlgValuesSupported)] public ICollection AuthorizationSigningAlgValuesSupported => _authorizationSigningAlgValuesSupported ?? - Interlocked.CompareExchange(ref _authorizationSigningAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _authorizationSigningAlgValuesSupported, new HashSet(), null) ?? _authorizationSigningAlgValuesSupported; /// @@ -232,7 +232,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.BackchannelAuthenticationRequestSigningAlgValuesSupported)] public ICollection BackchannelAuthenticationRequestSigningAlgValuesSupported => _backchannelAuthenticationRequestSigningAlgValuesSupported ?? - Interlocked.CompareExchange(ref _backchannelAuthenticationRequestSigningAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _backchannelAuthenticationRequestSigningAlgValuesSupported, new HashSet(), null) ?? _backchannelAuthenticationRequestSigningAlgValuesSupported; /// @@ -241,7 +241,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.BackchannelTokenDeliveryModesSupported)] public ICollection BackchannelTokenDeliveryModesSupported => _backchannelTokenDeliveryModesSupported ?? - Interlocked.CompareExchange(ref _backchannelTokenDeliveryModesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _backchannelTokenDeliveryModesSupported, new HashSet(), null) ?? _backchannelTokenDeliveryModesSupported; /// @@ -268,7 +268,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.ClaimsSupported)] public ICollection ClaimsSupported => _claimsSupported ?? - Interlocked.CompareExchange(ref _claimsSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _claimsSupported, new HashSet(), null) ?? _claimsSupported; /// @@ -277,7 +277,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.ClaimsLocalesSupported)] public ICollection ClaimsLocalesSupported => _claimsLocalesSupported ?? - Interlocked.CompareExchange(ref _claimsLocalesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _claimsLocalesSupported, new HashSet(), null) ?? _claimsLocalesSupported; /// @@ -295,7 +295,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.ClaimTypesSupported)] public ICollection ClaimTypesSupported => _claimTypesSupported ?? - Interlocked.CompareExchange(ref _claimTypesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _claimTypesSupported, new HashSet(), null) ?? _claimTypesSupported; /// @@ -304,7 +304,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.CodeChallengeMethodsSupported)] public ICollection CodeChallengeMethodsSupported => _codeChallengeMethodsSupported ?? - Interlocked.CompareExchange(ref _codeChallengeMethodsSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _codeChallengeMethodsSupported, new HashSet(), null) ?? _codeChallengeMethodsSupported; /// @@ -322,7 +322,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.DisplayValuesSupported)] public ICollection DisplayValuesSupported => _displayValuesSupported ?? - Interlocked.CompareExchange(ref _displayValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _displayValuesSupported, new HashSet(), null) ?? _displayValuesSupported; /// @@ -331,7 +331,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.DPoPSigningAlgValuesSupported)] public ICollection DPoPSigningAlgValuesSupported => _dPoPSigningAlgValuesSupported ?? - Interlocked.CompareExchange(ref _dPoPSigningAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _dPoPSigningAlgValuesSupported, new HashSet(), null) ?? _dPoPSigningAlgValuesSupported; /// @@ -369,7 +369,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.GrantTypesSupported)] public ICollection GrantTypesSupported => _grantTypesSupported ?? - Interlocked.CompareExchange(ref _grantTypesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _grantTypesSupported, new HashSet(), null) ?? _grantTypesSupported; /// @@ -387,7 +387,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.IdTokenEncryptionAlgValuesSupported)] public ICollection IdTokenEncryptionAlgValuesSupported => _idTokenEncryptionAlgValuesSupported ?? - Interlocked.CompareExchange(ref _idTokenEncryptionAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _idTokenEncryptionAlgValuesSupported, new HashSet(), null) ?? _idTokenEncryptionAlgValuesSupported; /// @@ -396,7 +396,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.IdTokenEncryptionEncValuesSupported)] public ICollection IdTokenEncryptionEncValuesSupported => _idTokenEncryptionEncValuesSupported ?? - Interlocked.CompareExchange(ref _idTokenEncryptionEncValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _idTokenEncryptionEncValuesSupported, new HashSet(), null) ?? _idTokenEncryptionEncValuesSupported; /// @@ -405,7 +405,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.IdTokenSigningAlgValuesSupported)] public ICollection IdTokenSigningAlgValuesSupported => _idTokenSigningAlgValuesSupported ?? - Interlocked.CompareExchange(ref _idTokenSigningAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _idTokenSigningAlgValuesSupported, new HashSet(), null) ?? _idTokenSigningAlgValuesSupported; /// @@ -423,7 +423,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.IntrospectionEndpointAuthMethodsSupported)] public ICollection IntrospectionEndpointAuthMethodsSupported => _introspectionEndpointAuthMethodsSupported ?? - Interlocked.CompareExchange(ref _introspectionEndpointAuthMethodsSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _introspectionEndpointAuthMethodsSupported, new HashSet(), null) ?? _introspectionEndpointAuthMethodsSupported; /// @@ -432,7 +432,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.IntrospectionEndpointAuthSigningAlgValuesSupported)] public ICollection IntrospectionEndpointAuthSigningAlgValuesSupported => _introspectionEndpointAuthSigningAlgValuesSupported ?? - Interlocked.CompareExchange(ref _introspectionEndpointAuthSigningAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _introspectionEndpointAuthSigningAlgValuesSupported, new HashSet(), null) ?? _introspectionEndpointAuthSigningAlgValuesSupported; /// @@ -489,7 +489,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.PromptValuesSupported)] public ICollection PromptValuesSupported => _promptValuesSupported ?? - Interlocked.CompareExchange(ref _promptValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _promptValuesSupported, new HashSet(), null) ?? _promptValuesSupported; /// @@ -516,7 +516,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.RequestObjectEncryptionAlgValuesSupported)] public ICollection RequestObjectEncryptionAlgValuesSupported => _requestObjectEncryptionAlgValuesSupported ?? - Interlocked.CompareExchange(ref _requestObjectEncryptionAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _requestObjectEncryptionAlgValuesSupported, new HashSet(), null) ?? _requestObjectEncryptionAlgValuesSupported; /// @@ -525,7 +525,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.RequestObjectEncryptionEncValuesSupported)] public ICollection RequestObjectEncryptionEncValuesSupported => _requestObjectEncryptionEncValuesSupported ?? - Interlocked.CompareExchange(ref _requestObjectEncryptionEncValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _requestObjectEncryptionEncValuesSupported, new HashSet(), null) ?? _requestObjectEncryptionEncValuesSupported; /// @@ -534,7 +534,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.RequestObjectSigningAlgValuesSupported)] public ICollection RequestObjectSigningAlgValuesSupported => _requestObjectSigningAlgValuesSupported ?? - Interlocked.CompareExchange(ref _requestObjectSigningAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _requestObjectSigningAlgValuesSupported, new HashSet(), null) ?? _requestObjectSigningAlgValuesSupported; /// @@ -579,7 +579,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.ResponseModesSupported)] public ICollection ResponseModesSupported => _responseModesSupported ?? - Interlocked.CompareExchange(ref _responseModesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _responseModesSupported, new HashSet(), null) ?? _responseModesSupported; /// @@ -588,7 +588,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.ResponseTypesSupported)] public ICollection ResponseTypesSupported => _responseTypesSupported ?? - Interlocked.CompareExchange(ref _responseTypesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _responseTypesSupported, new HashSet(), null) ?? _responseTypesSupported; /// @@ -606,7 +606,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.RevocationEndpointAuthMethodsSupported)] public ICollection RevocationEndpointAuthMethodsSupported => _revocationEndpointAuthMethodsSupported ?? - Interlocked.CompareExchange(ref _revocationEndpointAuthMethodsSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _revocationEndpointAuthMethodsSupported, new HashSet(), null) ?? _revocationEndpointAuthMethodsSupported; /// @@ -615,7 +615,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.RevocationEndpointAuthSigningAlgValuesSupported)] public ICollection RevocationEndpointAuthSigningAlgValuesSupported => _revocationEndpointAuthSigningAlgValuesSupported ?? - Interlocked.CompareExchange(ref _revocationEndpointAuthSigningAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _revocationEndpointAuthSigningAlgValuesSupported, new HashSet(), null) ?? _revocationEndpointAuthSigningAlgValuesSupported; /// @@ -633,14 +633,14 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.ScopesSupported)] public ICollection ScopesSupported => _scopesSupported ?? - Interlocked.CompareExchange(ref _scopesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _scopesSupported, new HashSet(), null) ?? _scopesSupported; /// /// Gets the that the IdentityProvider indicates are to be used signing tokens. /// [JsonIgnore] - public override ICollection SigningKeys { get; } = new Collection(); + public override ICollection SigningKeys { get; } = new HashSet(); /// /// Gets the collection of 'subject_types_supported'. @@ -648,7 +648,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.SubjectTypesSupported)] public ICollection SubjectTypesSupported => _subjectTypesSupported ?? - Interlocked.CompareExchange(ref _subjectTypesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _subjectTypesSupported, new HashSet(), null) ?? _subjectTypesSupported; /// @@ -672,7 +672,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.TokenEndpointAuthMethodsSupported)] public ICollection TokenEndpointAuthMethodsSupported => _tokenEndpointAuthMethodsSupported ?? - Interlocked.CompareExchange(ref _tokenEndpointAuthMethodsSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _tokenEndpointAuthMethodsSupported, new HashSet(), null) ?? _tokenEndpointAuthMethodsSupported; /// @@ -681,7 +681,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.TokenEndpointAuthSigningAlgValuesSupported)] public ICollection TokenEndpointAuthSigningAlgValuesSupported => _tokenEndpointAuthSigningAlgValuesSupported ?? - Interlocked.CompareExchange(ref _tokenEndpointAuthSigningAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _tokenEndpointAuthSigningAlgValuesSupported, new HashSet(), null) ?? _tokenEndpointAuthSigningAlgValuesSupported; /// @@ -699,7 +699,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.UILocalesSupported)] public ICollection UILocalesSupported => _uILocalesSupported ?? - Interlocked.CompareExchange(ref _uILocalesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _uILocalesSupported, new HashSet(), null) ?? _uILocalesSupported; /// @@ -717,7 +717,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.UserInfoEncryptionAlgValuesSupported)] public ICollection UserInfoEndpointEncryptionAlgValuesSupported => _userInfoEndpointEncryptionAlgValuesSupported ?? - Interlocked.CompareExchange(ref _userInfoEndpointEncryptionAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _userInfoEndpointEncryptionAlgValuesSupported, new HashSet(), null) ?? _userInfoEndpointEncryptionAlgValuesSupported; /// @@ -726,7 +726,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.UserInfoEncryptionEncValuesSupported)] public ICollection UserInfoEndpointEncryptionEncValuesSupported => _userInfoEndpointEncryptionEncValuesSupported ?? - Interlocked.CompareExchange(ref _userInfoEndpointEncryptionEncValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _userInfoEndpointEncryptionEncValuesSupported, new HashSet(), null) ?? _userInfoEndpointEncryptionEncValuesSupported; /// @@ -735,7 +735,7 @@ public OpenIdConnectConfiguration(string json) [JsonPropertyName(OpenIdProviderMetadataNames.UserInfoSigningAlgValuesSupported)] public ICollection UserInfoEndpointSigningAlgValuesSupported => _userInfoEndpointSigningAlgValuesSupported ?? - Interlocked.CompareExchange(ref _userInfoEndpointSigningAlgValuesSupported, new Collection(), null) ?? + Interlocked.CompareExchange(ref _userInfoEndpointSigningAlgValuesSupported, new HashSet(), null) ?? _userInfoEndpointSigningAlgValuesSupported; #region shouldserialize