On a new machine I installed Git for Windows 2.37.1.windows.1, which also installed Git Credential Manager Core 2.0.785+6074e4e3d3. I created a Bitbucket app password. Then I tried to access a private repository on my Bitbucket account using e.g. git pull
.
Git popped up an authentication dialog for Bitbucket. It had two options: authenticate with the browser, or authenticate with a password. I tried the password option first. I used my Bitbucket username and my newly created app password. I was able to access the repository.
But when I tried the exact same command, it popped up the authentication dialog again. I did the steps over and over. Each time it allowed me to access the repository, but it appeared the credentials were not being saved.
I opened Credential Manager in Windows and saw credentials for git:https://bitbucket.org
.
I tried to access the repository again, but this time I selected the option to authenticate with the browser. It sent me to some web page, and since I was already logged on at the Bitbucket site, it said I was authenticated. I was able to access the repository. And now I am able to access the repository without an authentication dialog each time.
Note that if I create a GitHub personal access token and enter it in the authentication dialog, Git seems to save it so I'm not required to enter it each time.
Why didn't Bitbucket store my credentials? Why did it require me to authenticate through the browser? If I'm forced to authenticate through the browser, what's the point of having an app password? And where is this specific scenario documented?
Update After authenticating with the browser (one of the two options in the "Connect to Bitbucket" authentication dialog in Git for Windows), I was able to continue using Git without further authentication on the Windows 10 Command Prompt. Ah, but then I switched to PowerShell and the whole thing happened all over again: I got the authentication dialog every time I tried to e.g. git push
. Each time I was successful with the "Password" option, using my app password, but it never saved the password, requiring me to reenter the password each time.
So once again I chose the "Browser" option in the dialog; it took me to a Bitbucket web page, which said (as I was already logged in):
Authentication Successful Git Credential Manager has been successfully authenticated. You may now close this page.
Now I can git push
as much as I like from PowerShell, now that I authenticated using "Browser".
So the question remains: why does Bitbucket's authentication dialog for Git for Windows use the saved app password and instead require that I reenter it each time? (Note that I have since updated to Git for Windows 2.37.2.windows.2.)