You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
curl -X GET https://bitbucket.org/site/oauth2/authorize?client_id={my_client_id}&response_type=code
I use my own client_id above.
get refresh token code fails. There is no output. Even if I do -o output.txt
If I take this string and put in a browser I get the code. (fails using curl)
I need this automated using curl.
Hi David,
This code needs to be obtained from the browser, it is not possible to get it with curl. Please note though that this needs to be done once when you set up OAuth. Also, the call to get refresh tokens is different and you can use curl for that.
After you use this in a browser and get a code
https://bitbucket.org/site/oauth2/authorize?client_id={consumer_key}&response_type=code
then you can get an access token and a refresh token with a call like this:
curl -X POST -u "key:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=authorization_code -d code=huPPKResiPcsLaqjj4
The output will include an access token you can use for up to 2 hours and a refresh token.
You can then use the refresh token to generate a new access token and refresh token with the following call:
curl -X POST -u "key:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=refresh_token -d refresh_token={2Eoiw6UJ707AD9aIyUR}
This will give you another access token and refresh token. From then on, you can use the last call to generate new access and refresh tokens.
Please feel free to let me know if you have any questions.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome, please feel free to reach out if you ever need anything else!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.