private static AuthenticationTicket BuildAuthenticationTicket(ServiceTicket ticket)
        {
            var assertion = ticket.Assertion;
            var identity  = new CasIdentity(assertion, ticket.AuthenticationType);

            identity.AddClaims(ticket.Claims);
            return(new AuthenticationTicket(
                       identity,
                       new AuthenticationProperties
            {
                IssuedUtc = assertion.ValidFrom,
                ExpiresUtc = assertion.ValidUntil
            }));
        }
예제 #2
0
        protected AuthenticationTicket BuildAuthenticationTicket(ServiceTicket ticket)
        {
            if (ticket == null)
            {
                return(null);
            }
            var assertion = ticket.Assertion;
            var identity  = new CasIdentity(assertion, ticket.AuthenticationType);

            identity.AddClaims(ticket.Claims.Select(x => x.ToClaim()));
            return(new AuthenticationTicket(
                       identity,
                       new AuthenticationProperties {
                IssuedUtc = assertion.ValidFrom,
                ExpiresUtc = assertion.ValidUntil
            }));
        }