Example #1
0
        /// <summary>
        /// Reads token from token string and creates ClaimsPrincipals if the token is valid.
        /// Token string must be in "Scheme xxx.." form such as "Bearer xxx"
        /// </summary>
        public ClaimsPrincipal Read(string token)
        {
            JwtClaimsPrincipalValidator validator = new JwtClaimsPrincipalValidator(Options);

            return(validator.Get(token));
        }
Example #2
0
        /// <summary>
        /// Reads token from Request and creates ClaimsPrincipals if the token is valid
        /// </summary>
        public ClaimsPrincipal Read(HttpRequest request)
        {
            JwtClaimsPrincipalValidator validator = new JwtClaimsPrincipalValidator(Options);

            return(validator.Get(request));
        }