Esempio n. 1
0
        public void TokenStringNotNull()
        {
            var token       = new JwtSecurityHelper(_settings.Object);
            var tempGuid    = Guid.NewGuid().ToString();
            var jwt         = token.GetToken(tempGuid);
            var tokenString = token.GetTokenValue(jwt);

            Assert.NotEmpty(tokenString);
        }
Esempio n. 2
0
        public void TokenStringValidation()
        {
            var token       = new JwtSecurityHelper(_settings.Object);
            var tempGuid    = Guid.NewGuid().ToString();
            var jwt         = token.GetToken(tempGuid);
            var tokenString = token.GetTokenValue(jwt);
            var handler     = new JwtSecurityTokenHandler();
            var result      = handler.ReadJwtToken(tokenString);

            Assert.Equal(_settings.Object.Value.Issuer, result.Issuer);
        }