コード例 #1
0
ファイル: SecEvent.cs プロジェクト: watfordgnf/Jwt
        /// <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 });
            }
        }
コード例 #2
0
ファイル: SecEvent.cs プロジェクト: watfordgnf/Jwt
        /// <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);
            }
        }
コード例 #3
0
ファイル: SecEvent.cs プロジェクト: watfordgnf/Jwt
        /// <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
                });
            }
        }