My App Password works for Git when I have the URL in the form
git clone https://{username}:{app_password}/....
Now that we need to transition to API Tokens, I created one (didn't specify the scope) and tried to use it using all the methods documented and I always get an authentication error.
git clone https://{username}:{token}/....
git clone https://x-bitbucket-api-token-auth:{token}/....
git clone https://x-token-auth:{token}/....
git clone -c http.extraHeader='Authorization: Bearer ...'
I made sure to URL encode the token, still it is failing to authenticate.
Is this even working at this time?
Thanks
Matt
Hi @Matthew Soh
You'll need to create the API token and specify the scope - this is mentioned in our deprecation documentation:
Atlassian Account settings > Security tab > Create and manage API Tokens
read:repository:bitbucket and write:repository:bitbucket - clone only would just be read
git clone https://username:APIToken@bitbucket.org/workspaceID/reposlug.git
Please let me know how this goes.
Cheers!
Ben (Bitbucket Cloud Support)
Thanks, Ben - this works!
I remember trying it before with a scoped token, but I must have chosen the wrong permissions. When that failed, I assumed that omitting the scope would grant all permissions.
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.
ssh access keys works only for pull requests not push requests
access tokens with scope for read, write are required for push requests both in comand line git and in sourcetree
With access tokens origin url/path has to be set properly for push requests to go through.
set global config user.email as specified during the creation of access token , either using commandline git or through sourcetree gui for example 3cfhyuggbcxffkhhhlkjjhccx@bots.bitbucket.org
set config origin https://x-token-auth@bitbucket.org/{workspace-ID}/{repo-ID}.git either in command line git or in sourcetree, you will be prompted for password , provide the access token as password.
If you are using sourcetree the access token will be saved in your computer keychain and you dont need to provide password everytime it will be automatically picked from your keychain next time you try to push.
In command line git you need to provide access token as password everytime you push which is cumbersome, so try to use sourcetree which is both secure and easy.
It took me whole 3 days to understand the process
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.