@param attempt: L{_PasswordResetAttempt}

        reset the password of the user who initiated C{attempt} to C{newPassword},
        and afterward, delete the attempt and any persistent sessions that belong
        to the user
338970
def resetPassword(self, attempt, newPassword):
        

        self.accountByAddress(attempt.username).password = newPassword

        self.store.query(
            PersistentSession,
            PersistentSession.authenticatedAs == str(attempt.username)
            ).deleteFromStore()

        attempt.deleteFromStore()
694656
protected void retryDelay(int attemptCount) {
        if (attemptCount > 0) {
            try {
                Thread.sleep(attemptCount * retryDelay);
            } catch (InterruptedException e) {
                LOG.debug("Failed to sleep: " + e, e);
            }
        }
    }
162033
def capture_reset_password_requests(reset_password_sent_at=None):
    
    reset_requests = []

    def _on(app, **data):
        reset_requests.append(data)

    reset_password_instructions_sent.connect(_on)

    try:
        yield reset_requests
    finally:
        reset_password_instructions_sent.disconnect(_on)
567571
def attempt(tries, &blk)
      if tries
        raise ArgumentError unless tries > 0
      else
        tries ||= @attempts
      end

      attempt = 1

      while true
        begin
          return yield blk
        rescue Errno::ECONNREFUSED, HTTPClient::TimeoutError,
               CorruptResult => e
          raise e if attempt == tries
          sleep 2 ** attempt
          attempt += 1
        end
      end
    end
1127084
@Override
	public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
		String requestURI = request.getRequestURI();
		UserAuthentication userAuth = null;
		User user = null;

		if (requestURI.endsWith(PASSWORD_ACTION)) {
			user = new User();
			user.setIdentifier(request.getParameter(EMAIL));
			user.setPassword(request.getParameter(PASSWORD));
			String appid = request.getParameter(Config._APPID);
			if (!App.isRoot(appid)) {
				App app = Para.getDAO().read(App.id(appid));
				if (app != null) {
					user.setAppid(app.getAppIdentifier());
				}
			}
			if (User.passwordMatches(user) && StringUtils.contains(user.getIdentifier(), "@")) {
				//success!
				user = User.readUserForIdentifier(user);
				userAuth = new UserAuthentication(new AuthenticatedUserDetails(user));
			}
		}
		return SecurityUtils.checkIfActive(userAuth, user, true);
	}
337535
def undo_sign_in(entry, session=None):
     # noqa
    if session is None:
        session = Session()
    else:
        session = session

    entry_to_delete = (
        session
        .query(Entry)
        .filter(Entry.uuid == entry.uuid)
        .one_or_none()
    )

    if entry_to_delete:
        logger.info('Undo sign in: {}'.format(entry_to_delete.user_id))
        logger.debug('Undo sign in: {}'.format(entry_to_delete))
        session.delete(entry_to_delete)
        session.commit()
    else:
        error_message = 'Entry not found: {}'.format(entry)
        logger.error(error_message)
        raise ValueError(error_message)
913420
public void setAttempts(java.util.Collection<AttemptDetail> attempts) {
        if (attempts == null) {
            this.attempts = null;
            return;
        }

        this.attempts = new java.util.ArrayList<AttemptDetail>(attempts);
    }
1254180
def setNewPassword(self, url, username, password):
        
        self.br.add_password(url, username, password)
854142
public void attemptLogin() {

        // Reset errors.
        mEmail.setError(null);
        mPassword.setError(null);

        // Check for a valid email address.
        if (TextUtils.isEmpty(mEmail.getText())) {
            mEmail.setError(getString(R.string.error_field_required));
            return;
        }

        q.task(new CocoTask<String>() {
            @Override
            public String backgroundWork() throws Exception {
                Thread.sleep(2000);
                return "Hello ";
            }

            @Override
            public void callback(String result) {
                q.toast(result+mEmail.getText());
               // q.startActivity(ListAct.class);
            }

            @Override
            public void pre() {
                q.v(mLoginStatusMessage).text(R.string.login_progress_signing_in);
            }
        }.progress(mLoginStatus).view(mLoginForm));
    }
1195586
public void setUserPassword(String password) {
		try {
			getSipURI().setUserPassword(password);
		} catch (ParseException e) {
			logger.error("error setting parameter ", e);
			throw new IllegalArgumentException("Bad arg", e	);
		}
	}
1042031
public void setErrorOldPassword(UserError error, String style) {

        m_oldPasswordField.setComponentError(error);
        m_oldPasswordStyle.setStyle(style);
    }
432787
public void assertPasswordCorrect(String password) {
		if (!isPasswordSet()) {
			throw new IllegalStateException("'" + updateConfigPasswordKey + "' is not set.");
		}

		if (!isPasswordCorrect(password)) {
			throw new IllegalStateException("Wrong password for '" + updateConfigPasswordKey + "'.");
		}
	}
1187694
@PostMapping(
      value = "/password/reset",
      headers = "Content-Type=application/x-www-form-urlencoded")
  @ResponseStatus(HttpStatus.NO_CONTENT)
  public void resetPassword(@Valid @ModelAttribute PasswordResetRequest passwordResetRequest) {
    accountService.resetPassword(passwordResetRequest.getEmail());
  }
1105857
def resetPassword(self, userId):
    '''
    
    '''
    self._setHeaders('resetPassword')
    return self._sforce.service.resetPassword(userId)
723402
private void attemptLogin() {
    if (mAuthTask != null) {
      return;
    }

    // Reset errors.
    mEmailView.setError(null);
    mPasswordView.setError(null);

    // Store values at the time of the login attempt.
    String email = mEmailView.getText().toString();
    String password = mPasswordView.getText().toString();

    boolean cancel = false;
    View focusView = null;

    // Check for a valid password, if the user entered one.
    if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) {
      mPasswordView.setError(getString(R.string.error_invalid_password));
      focusView = mPasswordView;
      cancel = true;
    }

    // Check for a valid email address.
    if (TextUtils.isEmpty(email)) {
      mEmailView.setError(getString(R.string.error_field_required));
      focusView = mEmailView;
      cancel = true;
    } else if (!isEmailValid(email)) {
      mEmailView.setError(getString(R.string.error_invalid_email));
      focusView = mEmailView;
      cancel = true;
    }

    if (cancel) {
      // There was an error; don't attempt login and focus the first
      // form field with an error.
      focusView.requestFocus();
    } else {
      // Show a progress spinner, and kick off a background task to
      // perform the user login attempt.
      showProgress(true);
      mAuthTask = new UserLoginTask(email, password);
      mAuthTask.execute((Void) null);
    }
  }
1023957
public function attemptResetPassword($resetCode, $newPassword)
	{
		if ($this->checkResetPasswordCode($resetCode))
		{
			$this->password = $newPassword;
			$this->reset_password_code = null;
			return $this->save();
		}

		return false;
	}
1183610
public void checkPassword(String value) {

        if (!value.equals(password)) {
            throw Error.error(ErrorCode.X_28000);
        }
    }