Sholo.Web.Security/Authentication/User/UserAuthentication.cs
/// <summary>
/// Calculates the hash of the formsAuthenticationTicket and compares it 
/// to the expected hash
/// </summary>
/// <param name="formsAuthenticationTicket">The formsAuthenticationTicket to hash</param>
/// <param name="expectedHash">The expected hash value</param>
/// <returns>A boolean indicating whether the expectedHash is correct</returns>
Calculates the hash of the formsAuthenticationTicket and compares it
to the expected hash
Calculates the hash of the formsAuthenticationTicket and compares it to the expected hash
public static bool ValidateFormsAuthTicketHash(FormsAuthenticationTicket formsAuthenticationTicket, string expectedHash)
        {
            if (formsAuthenticationTicket == null)
            {
                throw new ArgumentNullException("formsAuthenticationTicket", "formsAuthenticationTicket parameter cannot be null.");
            }
            if (expectedHash == null)
            {
                throw new ArgumentNullException("expectedHash", "expectedHash parameter cannot be null or empty.");
            }
            if (string.IsNullOrEmpty(expectedHash))
            {
                throw new ArgumentException("expectedHash parameter cannot be null or empty.", "expectedHash");
            }
            string calculatedHash = CalculateFormsAuthTicketHash(formsAuthenticationTicket);
            return (string.Compare(expectedHash, calculatedHash, StringComparison.Ordinal) == 0);
        }
public static bool ValidateFormsAuthTicketHash ( FormsAuthenticationTicket formsAuthenticationTicket , string expectedHash ) { if ( formsAuthenticationTicket == null ) { throw new ArgumentNullException ( " " , " " ) ; } if ( expectedHash == null ) { throw new ArgumentNullException ( " " , " " ) ; } if ( string . IsNullOrEmpty ( expectedHash ) ) { throw new ArgumentException ( " " , " " ) ; } string calculatedHash = CalculateFormsAuthTicketHash ( formsAuthenticationTicket ) ; return ( string . Compare ( expectedHash , calculatedHash , StringComparison . Ordinal ) == 0 ) ; }
Calculates the hash of the formsAuthenticationTicket and compares it
to the expected hash
Calculates the hash of the formsAuthenticationTicket and compares it to the expected hash
A boolean indicating whether the expectedHash is correct
A boolean indicating whether the expectedHash is correct
formsAuthenticationTicket
FormsAuthenticationTicket
The formsAuthenticationTicket to hash
The formsAuthenticationTicket to hash
expectedHash
string
The expected hash value
The expected hash value