public override ClaimsPrincipal ValidateToken(string token, TokenValidationParameters validationParameters, out SecurityToken validatedToken) { ClaimsPrincipal principal = base.ValidateToken(token, validationParameters, out validatedToken); var parsedToken = base.ReadJwtToken(token); TicketIdentity identity = TicketIdentity.ToIdentity(principal.Identity as ClaimsIdentity); TicketPrincipal TicketPrincipal = new TicketPrincipal(identity); return(TicketPrincipal); }
private ClaimsIdentity GetIdentity(IUser user) { if (user != null) { TicketIdentity myIdentity = new TicketIdentity(new GenericIdentity(user.Email), new List <Claim>(), "Standard", "name", "role", user); return(myIdentity); } else { return(null); } }
public static TicketIdentity ToIdentity(ClaimsIdentity identity) { TicketIdentity myIdentity = new TicketIdentity(identity, identity.Claims, identity.AuthenticationType, identity.NameClaimType, identity.RoleClaimType); return(myIdentity); }
public TicketPrincipal(TicketIdentity identity) : base() { this._identity = identity; identity.Principal = this; this.AddIdentity(identity); }