Credential Manager doesn't remember apppassword
Asked by Paul James:

I'm trying to setup a new machine to use as a build server.

It needs to be able to do pulls from bitbucket.org for the project its building.

I have an apppassword setup and that is being used however _every_ time I do a pull, clone etc the stupid window asking me to log in to your account pops up. I can click on the browser option and it says I'm already logged in, I can click on the password option and enter the apppassword.

No matter which option I use the next time I go to do a pull etc its back - WHY?

I've tried deleting the entries in windows credential manager, it just recreates them but seems to pay no attention to them.

This is totally unusable for a build server - its meant to be start the build and let it run, not have to constantly check back to see if there is a random prompt. This works fine on the existing machine just not on the new one.


Answers:
author: Patrik S
body: Hello [@Paul James](/t5/user/viewprofilepage/user-id/4950813) and thank you for reaching out to Community!

Git by itself does not cache credentials for authentication and relies on other tools, usually called credentials managers to store your credentials and use them in subsequent git commands.

From your description, it seems like you are using Windows, so I would suggest confirming if you have installed the [latest version of Git For Windows](https://git-scm.com/download/win), which already comes with Git Credential Manager installed (GCM).

If you have disabled the installation of GCM when you installed git, you can manually download and install GCM following the instructions in [this documentation.](https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/install.md)

Once GCM is installed, the next time you execute a git operation, it will prompt you for the credentials and then save it on GCM cache. For any subsequent git command, git will get the credentials from GCM cache and you will not need to provide it again.

You can confirm that git is configured to use GCM by using the following command :

```
git config --get-all --show-scope --show-origin credential.helper
```

This should print what is the current credential helper configured in your system at multiple scopes (local, global, system). If GCM is installed in the machine, we would expect the output of this command to return *managed**.*

Also, it's important to note that according to [GCM's documentation related to Bitbucket Authentication](https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/bitbucket-authentication.md) :
> If you are planning to use an [App Password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) for basic authentication, it must at a minimum have *Account Read* permissions (as shown below). If your App Password does not have these permissions, you will be re-prompted for credentials on every interaction with the server.

![Screenshot 2023-11-09 at 11.44.44?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/290966i70E46EDE149E1AB1/image-size/large?v=v2&px=999 "Screenshot 2023-11-09 at 11.44.44?AM.png")

So could you please confirm if the app password you are using contains at least the scopes shown in the image?

Let us know in case you have any questions.

Thank you, [@Paul James](/t5/user/viewprofilepage/user-id/4950813) !

Patrik S


Tags: bitbucket-cloud

cloud