src/DotNetCasClient.Memcached/State/MemcachedServiceTicketManager.cs
/// <summary>
/// Verify that the supplied casAuthenticationTicket exists in the ticket store
/// </summary>
/// <param name="casAuthenticationTicket">The casAuthenticationTicket to verify</param>
/// <returns>
/// True if the ticket exists in the ticket store and the properties of that
/// ticket match the properties of the ticket in the ticket store.
/// </returns>
Verify that the supplied casAuthenticationTicket exists in the ticket store
Verify that the supplied casAuthenticationTicket exists in the ticket store
public bool VerifyClientTicket(CasAuthenticationTicket casAuthenticationTicket)
        {
            CommonUtils.AssertNotNull(casAuthenticationTicket, "casAuthenticationTicket parameter cannot be null.");
            string incomingServiceTicket = casAuthenticationTicket.ServiceTicket;
            CasAuthenticationTicket cacheAuthTicket = GetTicket(incomingServiceTicket);
            if (cacheAuthTicket != null)
            {
                string cacheServiceTicket = cacheAuthTicket.ServiceTicket;
                if (cacheServiceTicket == incomingServiceTicket)
                {
                    if (String.Compare(cacheAuthTicket.NetId, casAuthenticationTicket.NetId, true) != 0)
                    {
                        SecurityLogger.Info("Username {0} in ticket {1} does not match cached value.",
                            casAuthenticationTicket.NetId, incomingServiceTicket);
                        return false;
                    }
                    if (String.Compare(cacheAuthTicket.Assertion.PrincipalName, casAuthenticationTicket.Assertion.PrincipalName, true) != 0)
                    {
                        SecurityLogger.Info("Principal name {0} in assertion of ticket {1} does not match cached value.",
                            casAuthenticationTicket.NetId, casAuthenticationTicket.Assertion.PrincipalName);
                        return false;
                    }
                    return true;
                }
            }
            else
            {
                SecurityLogger.Info("Ticket {0} not found in cache.  Never existed, expired, or removed via single sign out",
                    incomingServiceTicket);
                return false;
            }
            return false;
        }
public bool VerifyClientTicket ( CasAuthenticationTicket casAuthenticationTicket ) { CommonUtils . AssertNotNull ( casAuthenticationTicket , " " ) ; string incomingServiceTicket = casAuthenticationTicket . ServiceTicket ; CasAuthenticationTicket cacheAuthTicket = GetTicket ( incomingServiceTicket ) ; if ( cacheAuthTicket != null ) { string cacheServiceTicket = cacheAuthTicket . ServiceTicket ; if ( cacheServiceTicket == incomingServiceTicket ) { if ( String . Compare ( cacheAuthTicket . NetId , casAuthenticationTicket . NetId , true ) != 0 ) { SecurityLogger . Info ( " " , casAuthenticationTicket . NetId , incomingServiceTicket ) ; return false ; } if ( String . Compare ( cacheAuthTicket . Assertion . PrincipalName , casAuthenticationTicket . Assertion . PrincipalName , true ) != 0 ) { SecurityLogger . Info ( " " , casAuthenticationTicket . NetId , casAuthenticationTicket . Assertion . PrincipalName ) ; return false ; } return true ; } } else { SecurityLogger . Info ( " " , incomingServiceTicket ) ; return false ; } return false ; }
Verify that the supplied casAuthenticationTicket exists in the ticket store
Verify that the supplied casAuthenticationTicket exists in the ticket store
True if the ticket exists in the ticket store and the properties of that
ticket match the properties of the ticket in the ticket store.
True if the ticket exists in the ticket store and the properties of that ticket match the properties of the ticket in the ticket store .
casAuthenticationTicket
CasAuthenticationTicket
The casAuthenticationTicket to verify
The casAuthenticationTicket to verify