Access token is missing from response

Issue #79 invalid
Joseph Fusco created an issue

Following the example in the wiki, I am unable to get a successful response.

$oauth_params = array(
    'client_id'         => 'xxxxxxxxxx',
    'client_secret'     => 'xxxxxxxxxx'
);

$pull = new \Bitbucket\API\Repositories\PullRequests();
$pull->getClient()->addListener(
    new \Bitbucket\API\Http\Listener\OAuth2Listener($oauth_params)
);

$pull->all( $account_name, $repo_slug );

Fatal error: Uncaught Bitbucket\API\Exceptions\HttpResponseException: access_token is missing from response. {"error_description": "No callback uri defined for the OAuth client.", "error": "invalid_request"} in /Users/xxxxxxxxxx/vendor/gentle/bitbucket-api/lib/Bitbucket/API/Http/Listener/OAuth2Listener.php:135 Stack trace: #0 /Users/xxxxxxxxxx/vendor/gentle/bitbucket-api/lib/Bitbucket/API/Http/Listener/OAuth2Listener.php(75): Bitbucket\API\Http\Listener\OAuth2Listener->getAccessToken() #1 [internal function]: Bitbucket\API\Http\Listener\OAuth2Listener->preSend(Object(Buzz\Message\Request)) #2 /Users/xxxxxxxxxx/vendor/gentle/bitbucket-api/lib/Bitbucket/API/Http/Client.php(325): call_user_func_array(Array, Array) #3 [internal function]: Bitbucket\API\Http\Client->Bitbucket\API\Http{closure}(Object(Bitbucket\API\Http\Listener\OAuth2Listener), 'oauth2') #4 /Users/xxxxxxxxxx in /Users/xxxxxxxxxx/vendor/gentle/bitbucket-api/lib/Bitbucket/API/Http/Listener/OAuth2Listener.php on line 79

Comments (5)

  1. Alexandru Guzinschi

    access_token is missing from response. {"error_description": "No callback uri defined for the OAuth client."

    You need to define your callback URI on your OAuth consumer in the BitBucket UI.

  2. Log in to comment