Exemple #1
0
        /// <summary>
        /// Authenticates the user based on his or her password.
        /// </summary>
        /// <returns>True if the user authenticates correctly</returns>
        public bool Authenticate()
        {
            if (this.Password == null || this.EncodedPassword == null)
            {
                throw new HttpRequestException("The authentication can only be performed when both the encoded and the unencoded passwords are known.");
            }

            return(Encoder.AuthenticateUser(this));
        }
Exemple #2
0
    protected Boolean AuthenticateUser(string uname, string password)
    {
        try
        {
            // Query for the person with a username similar to the users input
            Encoder encoder = new Encoder();

            if (encoder.AuthenticateUser(uname, password))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        catch (Exception ex)
        {
            lbMessages.Text = ex.Message;
            return(false);
        }
    }