Exemple #1
0
        private static void ValidateEnvelope(JsonWebTokenEnvelope envelope)
        {
            if (envelope == null)
            {
                throw new ArgumentNullException("envelope");
            }

            if (envelope.Type != "JWT")
            {
                throw new JsonWebTokenException("Unsupported token type");
            }

            if (envelope.Algorithm != "HS256")
            {
                throw new JsonWebTokenException("Unsupported crypto algorithm");
            }
        }
Exemple #2
0
        private static void ValidateEnvelope(JsonWebTokenEnvelope envelope)
        {
            if (envelope == null) throw new ArgumentNullException("envelope");

            if (envelope.Type != "JWT")
                throw new JsonWebTokenException("Unsupported token type");

            if (envelope.Algorithm != "HS256")
                throw new JsonWebTokenException("Unsupported crypto algorithm");
        }