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:
- hardcode the
client_id:secretpart ==> no luck. - hardcode the
client_id:secretpart using thekeyandsecretfrom the OAuth page in my Bitbucket settings page as this:<key>:<secret>==> no luck. - hardcode the
client_id:secretpart using thekeyandsecretfrom the OAuth page in my Bitbucket settings page as this:<key>:<secret>(base64) encoded ==> no luck.
Questions:
- What am I doing wrong and how to fix it for the above curl command?
- If I'm going to try this in Postman as well, the
-dparameters should be put into the Body section but where to put the-u(client_id:secret) part?
PS. I do NOT want to put any of the client_id/secret/username/password in the URL.