public void TestMalformedHeader()
        {
            string res = jwt.GetHeader(token);

            Assert.IsTrue(SecurityUtils.compareStrings(res, ""));
            Assert.IsTrue(jwt.HasError());
        }
        public void TestGetHeader()
        {
            string header  = "{\"typ\":\"JWT\",\"alg\":\"HS256\"}";
            string header1 = "{\"alg\":\"HS256\",\"typ\":\"JWT\"}";
            string tHeader = jwt.GetHeader(token);

            Assert.IsTrue(SecurityUtils.compareStrings(header, tHeader) || SecurityUtils.compareStrings(header1, tHeader));
        }
Example #3
0
        public void Test_algorithm()
        {
            string header = jwt.GetHeader(token);

            Assert.IsTrue(SecurityUtils.compareStrings(header, expected));
        }