使用账号密码方式登录授权
@param string $username 用户名
@param string $password 密码
@return void
319
public function login($username, $password)
	{
		$response = $this->http->get($this->getUrl('oauth2/access_token'), array(
			'grant_type'	=>	'password ',
			'username'		=>	$username,
			'password'		=>	$password,
			'client_id'		=>	$this->appid,
			'client_secret'	=>	$this->appSecret,
		));
		$this->result = $response->json(true);
		if(!isset($this->result['error_code']))
		{
			return $this->accessToken = $this->result['access_token'];
		}
		else
		{
			throw new ApiException(isset($this->result['error']) ? $this->result['error'] : '', $this->result['error_code']);
		}
	}
1369681
public function withCredentials($username, $password)
    {
        if (null === $username || null === $password) {
            // No change if credentials or null
            return $this;
        }

        $new = $this->setValue('username', $username)
            ->setValue('password', $password)
            ->setValue('credentials', [$username, $password]);

        // To keep BC
        $new->username = $username;
        $new->password = $password;
        $new->credentials = [$username, $password];

        return $new;
    }
413395
protected function fireAttemptingEvent($username, $password)
    {
        if (isset($this->events)) {
            $this->events->fire(new Attempting($this->connection, $username, $password));
        }
    }
849428
public function basicAuth($username, $password)
    {
        $this->username = $username;
        $this->password = $password;
        return $this;
    }
291707
public function createUser($username, $password, $privilege = null)
    {
        $query = sprintf('CREATE USER %s WITH PASSWORD \'%s\'', $username, $password);

        if ($privilege) {
            $query .= " WITH $privilege PRIVILEGES";
        }

        return $this->client->query(null, $query);
    }
1033192
public function login($username = '', $password = '')
    {
        if (!$this->connected) {
            $this->setError('Not connected to POP3 server');
        }
        if (empty($username)) {
            $username = $this->username;
        }
        if (empty($password)) {
            $password = $this->password;
        }

        // Send the Username
        $this->sendString("USER $username" . static::LE);
        $pop3_response = $this->getResponse();
        if ($this->checkResponse($pop3_response)) {
            // Send the Password
            $this->sendString("PASS $password" . static::LE);
            $pop3_response = $this->getResponse();
            if ($this->checkResponse($pop3_response)) {
                return true;
            }
        }

        return false;
    }
366758
public function login($username, $password, $remember = 1)
	{
		$event = new Event('onPlatformLogin');
		$event->addArgument('username', $username);
		$event->addArgument('password', $password);
		$event->addArgument('remember', $remember);
		$event->addArgument('activePlugin', $this->activePlugin);

		Factory::getDispatcher()->triggerEvent($event);
	}
1284506
protected function _bindUser($username, $password)
    {
        $config = $this->getConfig();
        try {
            $ldapBind = $this->_ldap->bind($config['bindDN']($username), $password);
            if ($ldapBind === true) {
                $this->_ldap->unbind();

                return new ArrayObject([
                    $config['fields'][self::CREDENTIAL_USERNAME] => $username
                ]);
            }
        } catch (ErrorException $e) {
            $this->_handleLdapError($e->getMessage());
        }
        $this->_ldap->unbind();

        return null;
    }
1328835
public function setUsername($username = '')
    {
        $this->username = $username;
        $this->_debug->info(__FUNCTION__, 'setUsername: ', $this->username);
    }
412178
public function setBasicAuth(string $username, string $password)
    {
        $this->basicAuthUsername = $username;
        $this->basicAuthPassword = $password;
        return $this;
    }
18395
public function setCredentials(string $username, string $password): self
    {
        $this->bitFlag &= ~64;
        $this->bitFlag &= ~128;

        if ($username !== '') {
            $this->logger->debug('Username set, setting username flag');
            $this->bitFlag |= 128;
            $this->username = $username;
        }

        if ($password !== '') {
            $this->logger->debug('Password set, setting password flag');
            $this->bitFlag |= 64;
            $this->password = $password;
        }

        return $this;
    }
917161
public function setBasicAuth($username, $password)
    {
        $this->username = $username;
        $this->password = $password;

        return $this;
    }
1066467
public function auth($username = '', $password = '', $method = CURLAUTH_BASIC)
    {
        $this->auth['user'] = $username;
        $this->auth['pass'] = $password;
        $this->auth['method'] = $method;
    }
1039266
public function setPassword($password)
    {
        if (empty($password)) {
            $this->hashedPassword = null;
        } else {
            $this->hashedPassword = UsersManager::getPasswordHash($password);
        }
    }
228898
public function setAuth($username, $password)
    {
        if (!empty($username) && !empty($password)) {
            $this->username = stripslashes(trim($username));
            $this->password = stripslashes(trim($password));
        }
    }
1149478
public function addUser($username, $password, array $roles)
    {
        $this->userProvider->createUser(new User($username, $password, $roles));
    }
540169
public function setCredentials($username, $password)
    {
        $this->setCurlOption(CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
        $this->setCurlOption(CURLOPT_USERPWD, $username . ":" . $password);
    }