Esempio n. 1
0
        public void TestReadWriteJwt()
        {
            var jwtTokenParameters = new JwtTokenParameters
            {
                Audience = "local",
                Issuer   = "local",
                Key      = "8768747658765975758758758746"
            };

            var claimsIdentity = new ClaimsIdentity("testauth");

            claimsIdentity.AddClaim(new Claim(ClaimTypes.NameIdentifier, "111"));
            var jwt = jwtTokenParameters.WriteJwt(claimsIdentity);

            var claimsPrincipal = jwtTokenParameters.ReadJwt(jwt);
        }
Esempio n. 2
0
 public void OnGet()
 {
     Jwt = jwtTokenParameters.WriteJwt((ClaimsIdentity)User.Identity);
 }