Reputation: 43
When I connect to a TFS server using Git, the Git Credential Manager for Windows pops up a Microsoft login box. However, when I connect to a GitHub server, it raises a different login dialog for GitHub. I want to know what conditions the Git Credential Manager uses to control its popup box. It is the server. The server return value? The hostname?
Upvotes: 0
Views: 582
Reputation: 10596
It's based on the URL. Open the Credential Manager and you'll see something like this:
More details on the exact workflow are from here:
Manager flow:
git-credential finds that credential.helper=manager and invokes git-credential-manager with the "get" option.
git-credential-manager lacks credentials for the + . git-credential-manager looks at configuration + to determine if these are basic credentials, VSO m-factor, or GitHub 2-factor authentication.
In the case of basic credentials, git-credential-manager tells git-credential the truth that it does not have any credentials for it.
git-credential then prompts the user at the command line for credentials.
The user enters credentials.
git-credential invokes git-credential-manager with the store option and supplies the credentials for storage.
Further configuration can help you set a specific authorizing method, i.e. if I wanted to use NTLM to authorize communications with a TFS hosted git repo, I would enter
git config --system credential.myserver.com.authority Integrated
which would explicitly tell all repos to use Integrated/NTLM instead of having the user enter their username/password (not even once). Obviously, change myserver.com to your own domain. This also has the added advantage of not breaking when the user has to update their password. Otherwise, they'd have to manually delete/modify the credentials from the Credential Manager.
Upvotes: 1