2
votes

I'm trying to get a token through my OAuth application as written in the documentation, but I always get this error

{"error_description": "Invalid OAuth client credentials", "error": "unauthorized_client"}

My actions:

  1. I receive the code:

    https://bitbucket.org/site/oauth2/authorize?client_id={my_application_key}&response_type=code

  2. I want to receive a token for this code:

    curl -X POST -u "client_id: my_application_secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=authorization_code -d code={code}

Maybe I'm missing something?

Thanks!

1

1 Answers

3
votes

Replace all your client_id and secret with the consumer key and consumer secret respectively generated from your Bitbucket Settings' OAuth.

When you've successfully authorized your integrating app and generated the access_token via: https://bitbucket.org/site/oauth2/access_token , you should receive an access_token.

Cheers,

Anne