/// <summary>Validates the presence and the type of a required member.</summary> /// <param name="utf8Name"></param> protected void CheckRequiredMemberAsStringOrArray(JsonEncodedText utf8Name) { if (!TryGetValue(utf8Name, out var claim)) { ThrowHelper.ThrowJwtDescriptorException_SecEventAttributeIsRequired(utf8Name); } if (!claim.Type.IsStringOrArray()) { ThrowHelper.ThrowJwtDescriptorException_SecEventAttributeMustBeOfType(utf8Name, new[] { JwtValueKind.String, JwtValueKind.JsonEncodedString, JwtValueKind.Array }); } }
/// <summary>Validates the presence and the type of a required member.</summary> /// <param name="utf8Name"></param> protected void CheckRequiredMemberAsObject(JsonEncodedText utf8Name) { if (!TryGetValue(utf8Name, out var claim)) { ThrowHelper.ThrowJwtDescriptorException_SecEventAttributeIsRequired(utf8Name); } if (claim.Type != JwtValueKind.Object) { ThrowHelper.ThrowJwtDescriptorException_SecEventAttributeMustBeOfType(utf8Name, JwtValueKind.Object); } }
/// <summary>Validates the presence and the type of a required member.</summary> /// <param name="utf8Name"></param> protected void CheckRequiredMemberAsInteger(JsonEncodedText utf8Name) { if (!TryGetValue(utf8Name, out var claim)) { ThrowHelper.ThrowJwtDescriptorException_SecEventAttributeIsRequired(utf8Name); } if (!claim.Type.IsInteger()) { ThrowHelper.ThrowJwtDescriptorException_SecEventAttributeMustBeOfType(utf8Name, new[] { JwtValueKind.Int32, JwtValueKind.UInt32, JwtValueKind.Int64, JwtValueKind.UInt64 }); } }