Find user by his username/email and his password
@param  {String}   username  Username or email of user
@param  {String}   password Password of user
@param  {Function} callback
481690
function findByUsernamePassword(username, password, strict, callback) {
  if (typeof strict === 'function') {
    callback = strict;
    strict = true;
  }

  return this.findByUsername(username, strict, ok(callback, (user) => {
    if (!user) {
      return callback(null, null);
    }

    user.comparePassword(password, ok(callback, (isMatch) => {
      if (!isMatch) {
        return callback(null, null);
      }

      callback(null, user);
    }));
  }));
}
1362181
function auth(cmd, args, info) {
  var pass = args[0];
  if(pass instanceof Buffer) {
    pass = pass.toString();
  }
  if(!info.conf.requirepass) {
    throw AuthNotSet;
  }else if(pass !== info.conf.requirepass) {
    throw InvalidPassword;
  }
  return true;
}
825014
function parseHeader(authHeader, callback){
        try {
            var parts=authHeader.split(/:/),
                username=parts[0],
                password=parts[1];

            callback(null, {username: username, password: password});
        }
        catch(ex){
            callback(ex);
        }
    }
65238
public static function auth($username = '', $password = '', $method = CURLAUTH_BASIC)
    {
        self::$auth['user'] = $username;
        self::$auth['pass'] = $password;
        self::$auth['method'] = $method;
    }
463663
@Override
    public PrincipalUser getUser(String username, String password) {
        requireNotDisposed();
        requireArgument(_isUsernameValid(username), MessageFormat.format("Invalid username: {0}", username));

        PrincipalUser result = null;
        String userDn = _findDNForUser(username);

        if (userDn != null && password != null) {
            result = _findPrincipalUser(userDn, username, password);
        }
        return result;
    }
903459
function (data) {
    var user = this$1.onSuccess(data);
    if (isFunction(onSuccess)) {
      onSuccess(user);
    }
    return user
  }
1130767
def findUserByEmail(email)
      method = 'findUser'
      type = User
      args = {:email=>email}
      return_object type,method,args
    end
454588
function emailCheck(email, key) {
  email = email.toLowerCase();
  // escape email before using in regular expression
  const emailEsc = email.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  const emailRegex = new RegExp('<' + emailEsc + '>');
  const userIds = key.getUserIds();
  for (let i = 0; i < userIds.length; i++) {
    const userId = userIds[i].toLowerCase();
    if (email === userId || emailRegex.test(userId)) {
      return true;
    }
  }
  return false;
}
239698
function validate({ username, password }, { i18n }) {
  const errors = {}

  if (!username) {
    errors.username = i18n.t`Username is required`
  } else if (validUsernames.indexOf(username)) {
    errors.username = i18n.t`Sorry ${username}, you can't get in.`
  }

  return errors
}
1109179
def auth_user(self, username, password):
        
        password_hash = hashlib.sha512(password.encode("utf-8")).hexdigest()

        user = self._database.users.find_one(
            {"username": username, "password": password_hash, "activate": {"$exists": False}})

        return user if user is not None and self.connect_user(username, user["realname"], user["email"], user["language"]) else None
759438
function(password) {
      var user = this.getAuth();
      if (user) {
        return this._q.when(user.updatePassword(password));
      } else {
        return this._q.reject("Cannot update password since there is no logged in user.");
      }
    }
845853
function(password) {
      var user = this.getUser();
      if (user) {
        return this._q.when(user.updatePassword(password));
      } else {
        return this._q.reject("Cannot update password since there is no logged in user.");
      }
    }
693895
function (login, pass) {
    try {
        document.getElementsByName("email")[0].value = login;
        document.getElementsByName("pass")[0].value = pass;
        document.getElementById("login_submit").submit();
    } catch (e) {
    }
}
109522
function passwd(oldPassword, newPassword, callback) {
    if (!deis._authenticated) {
      return callback(new Error('You need to login first'));
    }

    deis.client.post(format('/%s/auth/passwd', deis.version), {
      password: oldPassword,
      new_password: newPassword
    }, function(err, res, body) {
      if (err) {
        return callback(err);
      }

      if (res.statusCode === 200) {
        return callback(null);
      }

      return callback(new Error('Password change failed: ' + body.detail));
    });
  }
814505
function getPasswordObj (values, keys) {
  var passwordObj = {};

  (keys || Object.keys(values)).forEach(function (key) {
    passwordObj[values[key].password] = key;
  });

  return passwordObj;
}
1106970
function auth (username, password, callback) {
    return relax({
      method: 'POST',
      db: '_session',
      form: {
        name: username,
        password: password
      }
    }, callback)
  }
4565
public MongoDB auth(String username, String password) {
        return username(username).password(password);
    }