|
|
@ -2216,8 +2216,7 @@ public static partial class OpenIddictServerHandlers |
|
|
=> values is [{ ValueType: ClaimValueTypes.String }], |
|
|
=> values is [{ ValueType: ClaimValueTypes.String }], |
|
|
|
|
|
|
|
|
// The following claims MUST be represented as unique strings or array of strings.
|
|
|
// The following claims MUST be represented as unique strings or array of strings.
|
|
|
Claims.AuthenticationMethodReference or Claims.Private.Audience or |
|
|
Claims.Private.Audience or Claims.Private.Presenter or Claims.Private.Resource |
|
|
Claims.Private.Presenter or Claims.Private.Resource |
|
|
|
|
|
=> values.TrueForAll(static value => value.ValueType is ClaimValueTypes.String) || |
|
|
=> values.TrueForAll(static value => value.ValueType is ClaimValueTypes.String) || |
|
|
// Note: a unique claim using the special JSON_ARRAY claim value type is allowed
|
|
|
// Note: a unique claim using the special JSON_ARRAY claim value type is allowed
|
|
|
// if the individual elements of the parsed JSON array are all string values.
|
|
|
// if the individual elements of the parsed JSON array are all string values.
|
|
|
@ -2225,6 +2224,17 @@ public static partial class OpenIddictServerHandlers |
|
|
JsonSerializer.Deserialize<JsonElement>(value) is { ValueKind: JsonValueKind.Array } element && |
|
|
JsonSerializer.Deserialize<JsonElement>(value) is { ValueKind: JsonValueKind.Array } element && |
|
|
OpenIddictHelpers.ValidateArrayElements(element, JsonValueKind.String)), |
|
|
OpenIddictHelpers.ValidateArrayElements(element, JsonValueKind.String)), |
|
|
|
|
|
|
|
|
|
|
|
// Note: unlike other claims (e.g "aud"), the "amr" claim MUST be represented as a unique
|
|
|
|
|
|
// claim representing a JSON array, even if a single authentication method reference
|
|
|
|
|
|
// is present in the collection. To avoid forcing users to use the special JSON_ARRAY
|
|
|
|
|
|
// value type, string values are also allowed here and normalized to JSON arrays
|
|
|
|
|
|
// by OpenIddict when generating an identity token based on the specified principal.
|
|
|
|
|
|
Claims.AuthenticationMethodReference |
|
|
|
|
|
=> values.TrueForAll(static value => value.ValueType is ClaimValueTypes.String) || |
|
|
|
|
|
(values is [{ ValueType: JsonClaimValueTypes.JsonArray, Value: string value }] && |
|
|
|
|
|
JsonSerializer.Deserialize<JsonElement>(value) is { ValueKind: JsonValueKind.Array } element && |
|
|
|
|
|
OpenIddictHelpers.ValidateArrayElements(element, JsonValueKind.String)), |
|
|
|
|
|
|
|
|
// The following claims MUST be represented as unique integers.
|
|
|
// The following claims MUST be represented as unique integers.
|
|
|
Claims.Private.AccessTokenLifetime or Claims.Private.AuthorizationCodeLifetime or |
|
|
Claims.Private.AccessTokenLifetime or Claims.Private.AuthorizationCodeLifetime or |
|
|
Claims.Private.DeviceCodeLifetime or Claims.Private.IdentityTokenLifetime or |
|
|
Claims.Private.DeviceCodeLifetime or Claims.Private.IdentityTokenLifetime or |
|
|
|