Log in the given User

@param User   $user     the user entity
@param string $password the password

@return string the generated Password
771261
public function login(User $user, $password)
    {
        if ($user->isPasswordValid($password)) {
            $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
            $this->tokenStorage->setToken($token);
            $user->setLastLogin(new \DateTime());
            $this->save($user);

            return true;
        }

        return false;
    }
782412
public function login( UserData $user ) {
		// clear session
		foreach ( $_SESSION as $key => $value ) {
			unset( $_SESSION[$key] );
		}

		// generate new session id
		session_regenerate_id( true );

		// store user info in session
		$this->setUser( $user );
	}
764481
public function login(User $user, $remember = false)
    {
        return $this->sentinel->login($user, $remember);
    }
1260098
public function changePassword(User $user)
    {
        if ($user->isGuest()) {
            Throw new UserException('Cannot change password of a guest.');
        }

        if (empty($user->getPassword())) {
            Throw new UserException('Cannot change an empty password');
        }

        $hashgen = new HashGenerator($user->getPassword());
        $hashgen->setSalt($this->salt);
        $password = $hashgen->generate();

        // Check the old password
        $this->db->qb([
            'table' => $this->table,
            'method' => 'UPDATE',
            'fields' => 'password',
            'filter' => 'id_user=:id_user',
            'params' => [
                ':id_user' => $user->getId(),
                ':password' => $password
            ]
        ], true);

        $user->setPassword($password);
    }
1338689
public function login(string $username, string $password)
    {
        $this->userInfo = $this->makeRequest('POST', 'login', compact('username', 'password'));

        if (!isset($this->userInfo['error']) && isset($this->userInfo['data']['id'])) {
            return true;
        }

        return false;
    }
1238204
public function login($username, $password)
    {
        $data = $this->matrix()->request('POST', $this->endpoint('login'), [
            'type' => 'm.login.password',
            'user' => $username,
            'password' => $password
        ]);
        $this->setData($data);
        return $this->data;
    }
1340706
public function getAuthAdapter(\Gems_User_User $user, $password)
    {
        $config = $this->project->getLdapSettings();

        $adapter = new LdapAdapter();

        // \MUtil_Echo::track($config);
        foreach ($config as $server) {
            $adapter->setOptions([$server]);

            if (isset($server['accountDomainNameShort'])) {
                $userName = $server['accountDomainNameShort'] . '\\' . $user->getLoginName();
            } else {
                $userName = $user->getLoginName();
            }

            $adapter->setUsername($userName)
                    ->setPassword($password);
        }

        return $adapter;
    }
1181990
public function setProxyAuth($user, $password)
    {
        $this->setProxyUser($user);
        $this->setProxyPassword($password);

        return $this;
    }
1274205
public function userPassword($password = null)
    {
        if ($password === null) {
            return $this->_userPassword;
        }
        $this->_userPassword = $password;

        return $this;
    }
1133015
public function actionValidatePassword($user, $password)
    {
        $user = $this->getUser($user);
        $result = $user->validatePassword($password);
        if ($result) {
            echo "Correct.\n";
        } else {
            echo "Incorrect.\n";
        }
        return static::EXIT_CODE_NORMAL;
    }
875098
protected function login(Request $request, User $user)
    {
        impersonate()->login($user);

        // if redirect url in request
        if ($request->has('redirect_to')) {
            return redirect($request->get('redirect_to'));
        }

        return back();
    }
1185618
protected function login($user, $password)
    {
        list($code, $response) = $this->execute('LOGIN', array(
            $this->escape($user), $this->escape($password)), self::COMMAND_CAPABILITY | self::COMMAND_ANONYMIZED);

        // re-set capabilities list if untagged CAPABILITY response provided
        if (preg_match('/\* CAPABILITY (.+)/i', $response, $matches)) {
            $this->parseCapability($matches[1], true);
        }

        if ($code == self::ERROR_OK) {
            return $this->fp;
        }

        return $code;
    }
599473
public function login($user,$password,$storeCookie=false) {
        $this->user=$user;
        $this->password=$this->encrypt($password);
        $this->uid=$this->genUID();
        //$this->other=$other;
        if (call_user_func($this->loginFn,$this)) {
            $this->fixSession($storeCookie && $this->useCookie);
            return true;
        } else {
            @session_destroy();
            @session_write_close();
            $this->isLogged=false;
            return false;
        }
    }
90812
public function makeUserLoggedIn($user)
    {
        if (!is_array($user) && !is_object($user)) {
            $user = $this->getUser($user);
        } elseif (!($user instanceof UserDataInterface)) {
            $user = new UserData($user);
        }

        if ($user->isNull()) {
            return false;
        }

        return $this->getHandler()->login($user);
    }
473533
protected function resetPassword($user, $password)
    {
        $user->forceFill([
            'password' => bcrypt($password),
            'remember_token' => Str::random(60),
        ])->save();
    }
863294
public function getAuthAdapter(\Gems_User_User $user, $password)
    {
        $adapter = new \Gems_Auth_Adapter_Callback(array($this->project, 'checkSuperAdminPassword'), $user->getLoginName(), array($password));
        return $adapter;
    }
56210
public function authenticate($username, $password)
    {
        try {
            $user = $this->userProvider->loadUserByUsername($username);
        } catch (UsernameNotFoundException $e) {
            return null;
        }

        $valid = $this->encoderFactory->getEncoder($user)->isPasswordValid(
            $user->getPassword(),
            $password,
            $user->getSalt()
        );

        if ($valid) {
            return $user;
        }

        return null;
    }