public virtual AuthenticationTicket Unprotect(string protectedText) { var sessionInfo = SessionInfoSigner.CreateFromSignedToken(protectedText, secret_); var claimsIdentity = new ClaimsIdentity(sessionInfo.IntoClaims(), authenticationType_); var claimsPrincipal = new ClaimsPrincipal(claimsIdentity); return(new AuthenticationTicket(claimsPrincipal, SessionCookieAuthenticationDefaults.AuthenticationScheme)); }
public string GetSignedTokenString() { if (Value == null) { return(null); } return(SessionInfoSigner.CreateSignedToken(Value, secret_)); }
public void SetFromSignedToken(string signedToken) { Value = SessionInfoSigner.CreateFromSignedToken(signedToken, secret_); }
public string Protect(AuthenticationTicket data) { SessionInfo sessionInfo = data.Principal.IntoSessionInfo(); return(SessionInfoSigner.CreateSignedToken(sessionInfo, secret_)); }