Compare user entered password with stored user's password
@param  {String}   candidatePassword
@param  {Function} callback
420980
function comparePassword(candidatePassword, callback) {
  bcrypt.compare(candidatePassword, this.password, (err, isMatch) => {
    if (err) {
      return callback(err);
    }

    callback(null, isMatch);
  });
}
472418
function loginUser(name, pass, cb) {
  // Get the user
  var db = nano().use(user_dbname)
  db.get(user_namespace+':'+name, function(err, doc) {
    if(err) return cb(err)
    
    // Check pass
    var hash = crypto.createHash('sha1')
    hash.update(pass)
    hash.update(doc.salt)
    var password_sha = hash.digest('hex')
    if(doc.password_sha === password_sha) {
      return cb(null, doc)
    }
    
    cb(new Error('Access denied.'))
  })
}
83837
private void loginUser(final String userId, final String password, final BooleanCallback callback) {
		LoginRequest request = new LoginRequest();
		request.setLogin(userId);
		request.setPassword(password);
		GwtCommand command = new GwtCommand(loginCommandName);
		command.setCommandRequest(request);
		GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<LoginResponse>() {

			public void execute(LoginResponse loginResponse) {
				if (loginResponse.getToken() == null) {
					if (callback != null) {
						callback.execute(false);
					}
					manager.fireEvent(new LoginFailureEvent(loginResponse.getErrorMessages()));
				} else {
					userToken = loginResponse.getToken();
					Authentication.this.userId = userId;
					UserDetail userDetail = GwtCommandDispatcher.getInstance().getUserDetail();
					userDetail.setUserId(loginResponse.getUserId());
					userDetail.setUserName(loginResponse.getUserName());
					userDetail.setUserOrganization(loginResponse.getUserOrganization());
					userDetail.setUserDivision(loginResponse.getUserDivision());
					userDetail.setUserLocale(loginResponse.getUserLocale());
					if (callback != null) {
						callback.execute(true);
					}
					manager.fireEvent(new LoginSuccessEvent(userToken));
				}
			}
		});
	}
1367105
function setServerPassword($password, $multicall = false)
    {
        if (!is_string($password)) {
            throw new InvalidArgumentException('password = ' . print_r($password, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($password), $multicall);
    }
384710
void showPasswordMatchError(boolean show) {

        if (show) {

            m_pw.setErrorPassword2(
                new UserError(CmsVaadinUtils.getMessageText(org.opencms.ui.Messages.GUI_PWCHANGE_PASSWORD_MISMATCH_0)),
                OpenCmsTheme.SECURITY_INVALID);
        } else {
            m_pw.setErrorPassword2(null, OpenCmsTheme.SECURITY_STRONG);
        }
    }
641022
public function emailResetLink(CanResetPasswordContract $user, $token, Closure $callback = null)
	{
		// We will use the reminder view that was given to the broker to display the
		// password reminder e-mail. We'll pass a "token" variable into the views
		// so that it may be displayed for an user to click for password reset.
		$view = $this->emailView;

		return $this->mailer->send($view, compact('token', 'user'), function($m) use ($user, $token, $callback)
		{
			$m->to($user->getEmailForPasswordReset());

			if ( ! is_null($callback))
			{
				call_user_func($callback, $m, $user, $token);
			}
		});
	}
1034197
function askForAdminPassword() {
    if (this.regenerate || this.serviceDiscoveryType !== 'eureka') return;

    const done = this.async();

    const prompts = [
        {
            type: 'input',
            name: 'adminPassword',
            message: 'Enter the admin password used to secure the JHipster Registry',
            default: 'admin',
            validate: input => (input.length < 5 ? 'The password must have at least 5 characters' : true)
        }
    ];

    this.prompt(prompts).then(props => {
        this.adminPassword = props.adminPassword;
        this.adminPasswordBase64 = getBase64Secret(this.adminPassword);
        done();
    });
}
261291
private void onSignInResult(int rstCode, SignInHuaweiId result) {
        HMSAgentLog.i("signIn:callback=" + StrUtils.objDesc(handler) +" retCode=" + rstCode);
        if (handler != null) {
            new Handler(Looper.getMainLooper()).post(new CallbackResultRunnable<SignInHuaweiId>(handler, rstCode, result));
            handler = null;
        }
        signInResultForDispose = null;
        retryTimes = MAX_RETRY_TIMES;
    }
734080
function onPopupRedirectSamlProviderClick() {
  var providerId = $('#popup-redirect-saml-providerid').val();
  var provider = new firebase.auth.SAMLAuthProvider(providerId);
  signInWithPopupRedirect(provider);
}
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.");
      }
    }
1065695
public boolean isPasswordCorrect(String password) {
		final String actualPassword = configurationRegistry.getString(updateConfigPasswordKey);
		return "".equals(actualPassword) || actualPassword != null && actualPassword.equals(password);
	}
24417
public function sendReminder(RemindableInterface $user, $token, Closure $callback = null)
	{
		// We will use the reminder view that was given to the broker to display the
		// password reminder e-mail. We'll pass a "token" variable into the views
		// so that it may be displayed for an user to click for password reset.
		$view = $this->reminderView;

		return $this->mailer->send($view, compact('token', 'user'), function($m) use ($user, $token, $callback)
		{
			$m->to($user->getReminderEmail());

			if ( ! is_null($callback)) call_user_func($callback, $m, $user, $token);
		});
	}
310167
function requirepass(val) {
  if(val && val.length > AUTHPASS_MAX_LEN) {
    throw new Error(
      util.format('Password is longer than %s', AUTHPASS_MAX_LEN));
  }
}
1232163
@SuppressWarnings({ "unchecked", "rawtypes" })
    private AuthenticationStatus handleFormLogin(String username, @Sensitive String password, HttpServletResponse rsp, Subject clientSubject,
                                                 HttpMessageContext httpMessageContext) throws AuthenticationException {
        AuthenticationStatus status = AuthenticationStatus.SEND_FAILURE;
        int rspStatus = HttpServletResponse.SC_UNAUTHORIZED;
        UsernamePasswordCredential credential = new UsernamePasswordCredential(username, password);
        status = utils.validateUserAndPassword(getCDI(), JavaEESecConstants.DEFAULT_REALM, clientSubject, credential, httpMessageContext);
        if (status == AuthenticationStatus.SUCCESS) {
            Map messageInfoMap = httpMessageContext.getMessageInfo().getMap();
            messageInfoMap.put("javax.servlet.http.authType", "FORM");
            messageInfoMap.put("javax.servlet.http.registerSession", Boolean.TRUE.toString());
            rspStatus = HttpServletResponse.SC_OK;
        } else if (status == AuthenticationStatus.NOT_DONE) {
            // set SC_OK, since if the target is not protected, it'll be processed.
            rspStatus = HttpServletResponse.SC_OK;
        } else {
            // TODO: Audit invalid user or password
        }
        rsp.setStatus(rspStatus);
        return status;
    }
748819
function setupUserNoUsername(callback) {
    //
    // Attempt to get the password three times.
    //
    var tries = 0;

    function offerReset (username) {
      jitsu.prompt.get(['reset'], function (err, res) {
        if (err) {
          return callback(err);
        }
        if (/^y[es]+/i.test(res['request password reset'])) {
          return jitsu.plugins.cli.executeCommand(['users', 'forgot', username ], callback);
        }

        callback(new Error('Invalid username / password.'));
      });
    }

    (function setupAuth () {
      jitsu.prompt.get(['password'], function (err, result) {
        if (err) {
          return callback(err);
        }

        jitsu.config.set('username', username);
        jitsu.config.set('password', result.password);
        jitsu.setup(function () {
          jitsu.auth(function (err) {
            //
            // Increment the auth attempts
            //
            tries += 1;

            if (err) {
              if (tries >= 3) {
                jitsu.log.error('Three failed login attempts');
                jitsu.log.info('Reset the password?');
                return offerReset(username);
              }
              return setupAuth();
            }
            // once password is entered checkout a token and clear out password 
            jitsu.tokens.create(username, (jitsu.config.get('apiTokenName')||'jitsu'), function(err, result) {
              if(!err && result) {
                var token = Object.getOwnPropertyNames(result).filter(function(n){return n !== 'operation'}).pop();
                jitsu.config.set('apiToken', result[token]);
                jitsu.config.set('apiTokenName', token);
                jitsu.config.clear('password');
                jitsu.config.save(function (err) {
                  return err ? callback(err) : callback();
                });
              }
            });
          });
        });
      });
    })();
  }
588618
@Override
    public void check(final List<TransportCandidate> localCandidates) {
        // TODO candidate is being checked trigger
        // candidatesChecking.add(cand);

        final ICECandidate checkingCandidate = this;

        Thread checkThread = new Thread(new Runnable() {
            @Override
            public void run() {

                final TestResult result = new TestResult();

                // Media Proxy don't have Echo features.
                // If its a relayed candidate we assumed that is NOT Valid while other candidates still being checked.
                // The negotiator MUST add then in the correct situations
                if (getType().equals(Type.relay)) {
                    triggerCandidateChecked(false);
                    return;
                }

                ResultListener resultListener = new ResultListener() {
                    @Override
                    public void testFinished(TestResult testResult, TransportCandidate candidate) {
                        if (testResult.isReachable() && checkingCandidate.equals(candidate)) {
                            result.setResult(true);
                            LOGGER.fine("Candidate reachable: " + candidate.getIp() + ":" + candidate.getPort() + " from " + getIp() + ":" + getPort());
                        }
                    }
                };

                for (TransportCandidate candidate : localCandidates) {
                    CandidateEcho echo = candidate.getCandidateEcho();
                    if (echo != null) {
                        if (candidate instanceof ICECandidate) {
                            ICECandidate iceCandidate = (ICECandidate) candidate;
                            if (iceCandidate.getType().equals(getType())) {
                                try {
                                    echo.addResultListener(resultListener);
                                    InetAddress address = InetAddress.getByName(getIp());
                                    echo.testASync(checkingCandidate, getPassword());
                                }
                                catch (UnknownHostException e) {
                                    LOGGER.log(Level.WARNING, "exception", e);
                                }
                            }
                        }
                    }
                }

                for (int i = 0; i < 10 && !result.isReachable(); i++)
                    try {
                        LOGGER.severe("ICE Candidate retry #" + i);
                        Thread.sleep(400);
                    }
                    catch (InterruptedException e) {
                        LOGGER.log(Level.WARNING, "exception", e);
                    }

                for (TransportCandidate candidate : localCandidates) {
                    CandidateEcho echo = candidate.getCandidateEcho();
                    if (echo != null) {
                        echo.removeResultListener(resultListener);
                    }
                }

                triggerCandidateChecked(result.isReachable());

                // TODO candidate is being checked trigger
                // candidatesChecking.remove(cand);
            }
        }, "Transport candidate check");

        checkThread.setName("Transport candidate test");
        checkThread.start();
    }
88507
function(handler, password, cbvalidpass) {
        this.A1 = Util.createHash(this.digestParts["username"] + ":" + this.realm + ":" + password);
        this.validate(handler, cbvalidpass);
    }