Gush\ThirdParty\Bitbucket\BitBucketClient::authenticate PHP Метод

authenticate() публичный Метод

Authenticates a user.
public authenticate ( array $credentials, null | string $authMethod = self::AUTH_HTTP_PASSWORD )
$credentials array BitBucket authentication credentials
$authMethod null | string One of the AUTH_* class constants
    public function authenticate($credentials, $authMethod = self::AUTH_HTTP_PASSWORD)
    {
        if ($authMethod === self::AUTH_HTTP_PASSWORD) {
            $listener = new BasicAuthListener($credentials['username'], $credentials['password']);
        } else {
            $listener = new OAuthListener(['oauth_consumer_key' => $credentials['key'], 'oauth_consumer_secret' => $credentials['secret']]);
        }
        $this->httpClient->addListener($listener);
    }