Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How use the new token in VS Code?

sansilvestreapps
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 11, 2026

I use the Source Control tool in VS Code to push my repository to Bitbucket. With the (old) app passwords, I just need to enter the password generated after performing the “push” in the prompt, so it’s very straightforward. According to the latest updates, I’ve generated an API token (valid for one year). How do I use it now? I tried replacing my current App Password with the new token, but I get a “Failed authentication” error. Thank you for your patience.

Screenshot 2026-06-11 101934.png

1 answer

0 votes
Ajay _view26_
Community Champion
June 11, 2026

Hi @sansilvestreapps 

Welcome to the community!

The authentication format changed when Atlassian moved to API tokens — you can't simply drop one in where an app password used to sit, because the username Git expects is different.

For Git over HTTPS (which is what VS Code's Source Control uses under the hood), you need to use the static username x-bitbucket-api-token-auth paired with your API token as the password. The fastest fix is to update your remote URL like this:

git remote set-url origin https://x-bitbucket-api-token-auth@bitbucket.org/<workspace>/<repo>.git

Then when VS Code prompts for credentials, enter x-bitbucket-api-token-auth as the username and paste your token as the password. You can also pre-bake it into the URL directly (x-bitbucket-api-token-auth:<token>@...) though storing tokens in URLs isn't ideal for shared machines.

One thing to double-check: make sure the token has Repositories: Read and Write scopes. A token scoped only to Account: Read won't be able to push even if the credential format is correct — that's a common cause of the "Failed authentication" error people see during the transition.

Also worth noting: app passwords are being fully retired on July 28, 2026 (with brownout windows already running), so this migration is the right call regardless. Docs here: https://support.atlassian.com/bitbucket-cloud/docs/using-api-tokens/

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events