Search code examples
bitbuckettokenaccess-tokenbitbucket-apirefresh-token

How to get bitbucket's refresh_token?


I am using the below API

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

to get access_token but access_token is expired in 1 hour and I need refresh_token but I am not able to get refresh_token in the above API's response. The response of above API is

https://www.example.com/#access_token={access_token}&scopes={scopes}&expires_in=3600&token_type=bearer

You can see in above response there is no Or is there any other way to get refresh_token.

I wanted to call the above API as GET method.

Can please someone help.

Thank You!


Solution

  • I got some solution. As I was using browser-based operations without server-side back-end support. In the Atlassian doc they have mentioned that Implicit and JWT are excluded the refresh_tokens. And If you want refresh_token as well then you need to use Authorization Code Grant first.