Exemplo n.º 1
0
        public ClaimsPrincipal GetPrincipal(string AuthenticationType, string token)
        {
            var json = new JwtBuilder()
                       .WithSecret(this.Secret)
                       .MustVerifySignature()
                       .Decode <IDictionary <string, string> >(token);
            var claimsIdentity = new ClaimsIdentity(json.Select(m => new Claim(m.Key, m.Value)), AuthenticationType);

            return(new ClaimsPrincipal(claimsIdentity));
        }