Ejemplo n.º 1
0
        /// <summary>
        /// Check and validate login based on username and password
        /// </summary>
        /// <param name="staff_user"></param>
        /// <param name="staff_password"></param>
        /// <returns>bool</returns>
        public bool AuthenticateLogin(string staff_user, string staff_password)
        {
            byte[]        bytes      = Encoding.Unicode.GetBytes(staff_password);
            SHA256Managed hashstring = new SHA256Managed();

            byte[] hash       = hashstring.ComputeHash(bytes);
            string hashString = string.Empty;

            foreach (byte x in hash)
            {
                hashString += String.Format("{0:x2}", x);
            }
            bool check = authRepo.ValidateLogin(staff_user, hashString);

            return(check);
        }