APP Password not working with Git Bash
Asked by RM_TR:

When the window "Connect to Bitbucket" appears I use my user name and APP password before continuing.

The I get to the window "OAuth authentication required"

So I click the button "Authorize".

Then a browser window pops up asking me to "Confirm access to my account"

I click "Grant access".

<br />

Then another browser window with the url "[https://localhost:34106/?state=7e8761ec8d8544bc813bc1b434425e00\&code=kwGbnV4HXNQPzhybqK](https://localhost:34106/?state=7e8761ec8d8544bc813bc1b434425e00&code=kwGbnV4HXNQPzhybqK)" pops up, but there is no server on localhost:34106 to handle that request.

What am I supposed to do?


Answers:
author: Theodora Boudale
body: Hi [@RM_TR](/t5/user/viewprofilepage/user-id/2424072),

It sounds like your machine may have a Git credential manager that asks for OAuth authentication, although I'm not sure why the error occurs, this could be a bug.

There may be some setting in the credential helper to use Basic authentication only. In order to be able to help you better, could you please let us know:

**1.** Since you are using Git Bash, I assume you are working on a Windows machine?

**2.** Could you please run the following command in Git Bash

```
git config --list
```

Check the output of the command and look for any lines that start with **credential.helper** Could you let us know what values are set for any such lines?

**3.** Are you only using Git Bash to clone/pull from/push to your Bitbucket repos? Or are you also using any Git GUI client?

Kind regards,  
Theodora

comments: author: RM_TR
body: 1. Yes.

2. credential.helper=manager-core

3. We only use Git Bash for clone/pull from/push.

Before I wrote I tried uninstalling Git bash and getting the newest version from here <https://git-scm.com/download/win>

For now we use the old way since APP Password isn't working. I hope a solution is found before the old way is removed as warned.


author: Theodora Boudale
body: Hi [@RM_TR](/t5/user/viewprofilepage/user-id/2424072),

Thank you for the reply.

If the credential manager is the following:

* <https://github.com/GitCredentialManager/git-credential-manager>

I have reproduced this and I get redirected to a similar URL, however, the browser shows me a message that authentication was successful. What message does your browser display when you get redirected to the localhost URL? If you see an error, the best place to ask would be here: <https://github.com/GitCredentialManager/git-credential-manager/issues> , since it's the credential manager prompting you to connect with OAuth.

If you want to disable OAuth and use Basic authentication only, I checked the configuration options here:

* <https://github.com/GitCredentialManager/git-credential-manager/blob/main/docs/configuration.md>

If I run the following command in my Git Bash

```
git config --global credential.bitbucketAuthModes "basic"
```

and then remove any stored credentials for bitbucket.org from the credential manager, then I only get asked for username+password authentication when cloning, which succeeds when I use username + app password.

Could you give this a try and let me know if it works for you?

Kind regards,  
Theodora


author: Brian Valenti
body: Running:

```
git config --global credential.bitbucketAuthModes "basic"
```

Worked for me.


author: RM_TR
body: [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)

I had tried clearing credentials before but using

```
git config --global credential.bitbucketAuthModes "basic"
```

helped. Thank you.

However, I don't understand why this was necessary with APP Password when it wasn't with regular account password.

Can you explain why that matters here?


author: Theodora Boudale
body: Hi [@RM_TR](/t5/user/viewprofilepage/user-id/2424072) and [@Brian Valenti](/t5/user/viewprofilepage/user-id/2802255), it's good to hear that this configuration helped!

[@RM_TR](/t5/user/viewprofilepage/user-id/2424072), regarding your question, I don't know why the credential manager asks for OAuth authentication when username+app password is used, but not when username+password was used. The credential manager is not developed by Atlassian so I'm not familiar with its implementation details and also whether this is expected behavior or not.

The best place to ask would be here <https://github.com/GitCredentialManager/git-credential-manager/issues> where the developers of the credential manager can address your question.

Kind regards,  
Theodora


author: Mat Jung
body: The proposed solution does not yet work on my device, based on git version 2.9.0.windows.1

At which versions / credential managers is it working for you?

comments: author: Theodora Boudale
body: Hi Mat,

I cannot recall the versions as I have since upgraded Git on the system I was using, but I believe it was newer than 2.9.0.

I would suggest upgrading Git if possible, as I see that version 2.9.0 is quite old, released in 2016: <https://github.com/git-for-windows/git/releases/tag/v2.9.0.windows.1>

If you're still experiencing issues, please create a new question via <https://community.atlassian.com/t5/forums/postpage/board-id/bitbucket-questions> and provide more details about the exact errors you get and we can look into it. It's best to have a separate question per issue, as the root cause for each issue may be different, and a post can become difficult to follow if we troubleshoot multiple users' (possibly different) issues in it.

Kind regards,  
Theodora


author: Mat Jung
body: Confirmed. winget upgrade Git - fixed the issue on my device

It is now on git 2.37.3


author: Theodora Boudale
body: That's good to hear, thank you for the update!


Tags: bitbucket-cloud

cloud

password