Checks the existing password for a user
515650
public boolean checkPasswordMatches(String id, String password, String zoneId) {
        String currentPassword;
        try {
            currentPassword =
                jdbcTemplate.queryForObject(
                    READ_PASSWORD_SQL,
                    new Object[] { id, zoneId},
                    new int[] { VARCHAR, VARCHAR },
                    String.class
                );
        } catch (IncorrectResultSizeDataAccessException e) {
            throw new ScimResourceNotFoundException("User " + id + " does not exist");
        }

        return passwordEncoder.matches(password, currentPassword);
    }
84314
def authenticate_user(self, request, user):
        
        return user.check_password(request.data.get('password')) or \
               self.check_user_token(request, user)
1247061
public function validatePassword()
    {
        /* @var $user User */
        $user = Yii::$app->user->identity;
        if (!$user || !$user->validatePassword($this->oldPassword)) {
            $this->addError('oldPassword', 'Incorrect old password.');
        }
    }
1021177
def check_password(self, raw_password):
        """"""
        return xmpp_backend.check_password(self.node, self.domain, raw_password)
341003
void checkPasswordMatch(String password2) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(password2)) {
            showPasswordMatchError(!password2.equals(m_form.getPassword1()));
        }
    }
883550
def get_user_password (self, url):
        
        for auth in self["authentication"]:
            if auth['pattern'].match(url):
                return (auth['user'], auth['password'])
        return (None, None)
664106
def check_password(password)
    return false unless key
    key == self.class.hash_password(password, key.split('|', 2).first)
  end
141081
def password(self, value):
        """"""
        if isinstance(value, str):
            self._password = value
            self._handler = None
1145439
def prompt_for_new_password():
    
    while True:
        passw = getpass.getpass()
        passw2 = getpass.getpass()
        if passw == passw2: return passw
        print 'Passwords do not match'
831018
def validate_current_password(self, value):
        
        if self.instance and self.instance.has_usable_password() and not self.instance.check_password(value):
            raise serializers.ValidationError(_('Current password is not correct'))
        return value
868313
function user_update_password($user, $newpassword) {
        $user = get_complete_user_data('id', $user->id);
        // This will also update the stored hash to the latest algorithm
        // if the existing hash is using an out-of-date algorithm (or the
        // legacy md5 algorithm).
        return update_internal_user_password($user, $newpassword);
    }
186054
def check_password_expired(user):
    
    if not settings.ACCOUNT_PASSWORD_USE_HISTORY:
        return False

    if hasattr(user, "password_expiry"):
        # user-specific value
        expiry = user.password_expiry.expiry
    else:
        # use global value
        expiry = settings.ACCOUNT_PASSWORD_EXPIRY

    if expiry == 0:  # zero indicates no expiration
        return False

    try:
        # get latest password info
        latest = user.password_history.latest("timestamp")
    except PasswordHistory.DoesNotExist:
        return False

    now = datetime.datetime.now(tz=pytz.UTC)
    expiration = latest.timestamp + datetime.timedelta(seconds=expiry)

    if expiration < now:
        return True
    else:
        return False
91295
def update_password(self, user, password, skip_validation=False):
        
        pwcol = self.options["password_column"]
        pwhash = self.bcrypt.generate_password_hash(password)
        if not skip_validation:
            self.validate_password(user, password, pwhash)
        if self.options['prevent_password_reuse']:
            user.previous_passwords = [getattr(user, pwcol)] + (user.previous_passwords or [])
            if self.options['max_password_reuse_saved']:
                user.previous_passwords = user.previous_passwords[:self.options['max_password_reuse_saved']]
        setattr(user, pwcol, pwhash)
        user.last_password_change_at = datetime.datetime.utcnow()
        user.must_reset_password_at_login = False
808999
def check_auth(self, username, password):
        """"""
        if username == self.args.username:
            from glances.password import GlancesPassword
            pwd = GlancesPassword()
            return pwd.check_password(self.args.password, pwd.sha256_hash(password))
        else:
            return False
292592
protected function ensureHashedPassword() {
    // the password is expected to be stored in the 'password' value
    $password = $this->getValue('password');
    if (strlen($password) > 0 && !PasswordService::isHashed($password)) {
      $this->setValue('password', PasswordService::hash($password));
    }
  }
1210749
def get_user_by_password(self, username, password):
        
        try:
            user = self.get(username=username)
        except User.DoesNotExist:
            return None
        
        if bcrypt.hashpw(password, user.pass_hash) == user.pass_hash:
            return user
        else:
            return None
34963
def change_password(self, old_password, new_password):
		""""""
		body = self._formdata({
			"old_password": old_password,
			"password": new_password,
		}, ["old_password", "password"])
		content = self._fetch("/current_user/password", method="POST", body=body)
		return FastlyUser(self, content)