示例#1
0
        public bool AuthenticateUser(string userId, string password)
        {
            _logger.Debug("Authenticating userId={0}", userId);

            var userCredentials = _authenticationRepository.Get(new Guid(userId), true);

            var isValidated = _passwordHash.Validate(userCredentials.PasswordHash, userId, password, SecretKey);

            var message = isValidated
                        ? "Successfully validated credentials for Id={0}"
                        : "Failed to validate credentials for Id={0}";

            _logger.Debug(message, userId);

            return(isValidated);
        }