Forums

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

Unable to use API Keys to login using WSL2 on Windows.

David Löfstrand
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!
October 6, 2025

Hello I have set up an API key with read and write permissions on the bitbucket repository in question.

Our product must use a WSL2 service we have so I need to checkout the repo for WSL2 as well.

 

I did read this site:
https://support.atlassian.com/bitbucket-cloud/docs/using-api-tokens/

 

However it just does not work however I try to check it out.

I tried it as:
git clone https://bitbucket.org/{company}/{repo}.git
Manually I enter the user name and as password I provide the API token I got.
Auth failed.

I tried both the "stripped" username I have as well as my email to login. Both fails with this error code:
remote: You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated.
fatal: Authentication failed for 'https://bitbucket.org/{company}/{repo}.git/'


Then I tried 
git clone https://my_user@bitbucket.org/{company}/{repo}.git

 


I also tried this due to the suggestions from the website above.
git clone https://my_user:VERY_VERBOSE_API_KEY@bitbucket.org/{company}/{repo}.git

Of course the last methods with my_user cannot be tested with email addresses as that contains "@". I did however try to escape the "@" sign but no avail.

How can I checkout the code in WSL2?
One critical part of our software needs to run as a service on a WSL2 machine.

 

As a side note I might add that on Windows it works perfectly after I visit a homepage and login. But I never get this option in WSL2, so I thought the API key with read/write repository would suffice.

 

Any hints of what to do?


Thanks in advance.

1 answer

1 accepted

2 votes
Answer accepted
David Löfstrand
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!
October 6, 2025

I found a stack-overflow answer to this here:
https://stackoverflow.com/questions/45925964/how-to-use-git-credential-store-on-wsl-ubuntu-on-windows

I had to enter this:

git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe"

It now works after this change so I guess this concludes this question.

As a side note I think it would be great to update the homepage to include WSL2 caveats at:
https://support.atlassian.com/bitbucket-cloud/docs/using-api-tokens/

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events