KimHansen
KimHansen

Reputation: 377

Bitbucket API authentication using curl (Postman)

I've tried to figure out how to authenticate with Bitbucket API 2, but with no luck so far.

It should be possible to authenticate and get an access token using the following curl command:

$ curl -i -X POST -u "client_id:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=password -d username=<username> -d password=<password>

I'm pretty confident that the <username> and <password> parts should be replaced with my username and password from Bitbucket. However, the client_id:secret part is confusing me.

I've tried the following:

Questions:

PS. I do NOT want to put any of the client_id/secret/username/password in the URL.

Upvotes: 3

Views: 8734

Answers (1)

Juan
Juan

Reputation: 41

You can place your user and password on Postman under the Authorization tab. Select Type Basic Auth and set your username and password. Execute your request and if it works, see the CURL request on "Code" link. Postman will display the CURL request with the Basic Auth token generated with your user and password details too.

Upvotes: 4

Related Questions