unauthorized_client when trying to authenticate via API for Bitbucket Cloud

wundermax I'm New Here Jan 17, 2018

I'm trying to use the Bitbucket API but I can't seem to authenticate. I'm using the sample cURL snippet that is displayed in the docs for 3. Resource Owner Password Credentials Grant (4.3).


I'm replacing username with my email address and password with my password like this:


curl -X POST -u "client_id:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=password -d username=email@provider.com -d password=my5password1


The response I get back is always:


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


I'm not sure what is going wrong. I've tried changing my password and using my username instead of my email address. I don't have two-step-verification enabled.


What else can I do to verify that my settings are correct?


Thanks a lot for your help! :)

1 answer

1 accepted

0 vote
wundermax I'm New Here Jan 17, 2018

I had to add an OAuth consumer in my account settings and replace "client_id:secret" with the information frmo the OAuth consumer.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,757 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you