Refresh oauth token on Bitbucket Server

Having obtained an oauth (v1) token from a Bitbucket Server, and used it to make various authenticated requests via the REST API, it appears that tokens are being revoked after some time.


Why are tokens revoked, is there a timeout?


Is there any way to obtain a new token without the user having to explicitly approve it? (or some other way to avoid the token being revoked)

1 answer

0 vote

Hi Josh, access tokens do expire. If you got a refresh token then you can use it to get a new access token without requesting authorization from the end user.

For more information you can see Things you should know about tokens.

Hope that helps!




How do I get a refresh token from the Bitbucket Server REST API (or how do I get one along with the oauth_token)?


-Currently, when the user approves the oauth request and their browser requests http:://the.bitbucket.server/plugins/servlet/oauth/authorize they get a redirect to the registered URL ('my' site) with query parameters specifying the oauth_token and oauth_verifier. That is to say, I don't get a refresh token.

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,767 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