Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to store the App Password in GCM

Ali Elshishini January 23, 2023

The formal doc page suggest to either interactively enter the App password each time
or store insecurely in the remote url 

https://support.atlassian.com/bitbucket-cloud/docs/using-app-passwords/

Why cant GCM just store the App password, like it store PAT for Azure?

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 25, 2023

Hello @Ali Elshishini ,

Thank you for reaching out to Atlassian Community!

The Git Credential Manager can indeed be used to store your authentication credentials for Bitbucket Cloud. You can install GCM following the instructions of official GCM installation guide , and it should already configure your git environment to start using GCM as the credential helper to cache your app password.

You can confirm if the credential manager was correctly configured by executing the following command in your system's terminal : 

git config --get-all  credential.helper

We would expect to see the path to GCM executable be listed.

Once GCM is set up, you should be prompted to input your credentials the first time you try to execute a git command. The credentials should then be cached and used in the subsequent git commands without requiring your manual input, as long as the credentials are still valid.

Hope that helps! Let me know in case you have any questions.

Thank you, @Ali Elshishini .

Patrik S

Ali Elshishini January 25, 2023

Hi @Patrik S 

Thanks for your reply
I was expecting the behavior you mentioned
But I get prompted for the password everytime 

git config --get-all  credential.helper

returns

manager

And I can also confirm that while working with Repositories on Azure Devops
the PAT password is cached, as I only got prompted once , the first time I made a push/pull or a clone 

Its just not working for BitBucket AppPassword  

Note that with PAT on Azure the token is generated automatically, at the prompt I login using my MSA Account for Azure

For BitBucket, I created an App Password, and used that with my BitBucket login name (which is different from my Atlassian Account)
Should I login using my Atlassian account, will this auto generate and save an app password? 

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 26, 2023

Hello @Ali Elshishini ,

GCM is compatible with two authentication methods when using Bitbucket cloud : 

  • Basic Auth: where you should input your bitbucket username  and app password
  • OAuth: where a popup window should open for you to log in on bitbucket UI (using your e-mail and account password) and grant GCM permission to access your account.

I assume that GCM is giving precedence to OAuth first, and that would explain you being prompted to log in multiple times, as OAuth tokens expire after 2 hours.

In this case, I would suggest trying to force GCM to use just basic authentication by changing the value of git's credential.bitbucketAuthModes setting using the following command : 

git config --global credential.bitbucketAuthModes "basic"

Then, once prompted for the credentials, provide your bitbucket username and app password. Since the app password has no expiration, you should not be prompted for credentials again in the following git commands.

If you run into any issues, let me know!

Thank you, @Ali Elshishini 

Patrik S

Suggest an answer

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

Atlassian Community Events