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));
        }
Beispiel #2
0
        public string GetSignedTokenString()
        {
            if (Value == null)
            {
                return(null);
            }

            return(SessionInfoSigner.CreateSignedToken(Value, secret_));
        }
Beispiel #3
0
 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_));
        }