Access token is missing from response
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)
-
-
- changed version to 1.1
-
reporter Ah thank you
-
reporter - changed status to closed
-
- changed status to invalid
- Log in to comment
You need to define your callback URI on your OAuth consumer in the BitBucket UI.