Exemplo n.º 1
0
        public string Protect(AuthenticationTicket data)
        {
            var roles = data.Identity.FindAll(ClaimTypes.Role).Select(c => c.Value);

            var otherCliams = data.Identity
                              .FindAll(IsNotSpecialClaim)
                              .Select(c => new SimpleClaim(c.Type, c.Value));

            AuthData auth = new AuthData(data.Identity.GetUserId(), data.Identity.GetUserName(), roles, otherCliams);

            string qsFormat = auth.ToString();

            return(qsFormat);
        }