Windows git authentication failed

Git for Windows Authentication failed #536

Comments

gitp31415926 commented Feb 1, 2018

Done an upgrade from Git for Windows 2.14 to 2.15. Somehow after the upgrade, I no longer able to login to my Git repo on visualstudio.com. I know I’m using the correct credentails to login because I can still login via browser / git from another PC. I’ve tried downgrade, install a different version of GCM, turn off GCM. Nothing works. Below is the trace log, hope someone could suggest what I could do next.

15:47:34.763052 git.c:328 trace: built-in: git ‘pull’
15:47:34.768059 run-command.c:626 trace: run_command: ‘fetch’ ‘—update-head-ok’
15:47:34.789056 git.c:328 trace: built-in: git ‘fetch’ ‘—update-head-ok’
15:47:34.800055 run-command.c:626 trace: run_command: ‘remote-https’ ‘origin’ ‘https://myrepo.visualstudio.com/repo’
15:47:34.822060 git.c:560 trace: exec: ‘git-remote-https’ ‘origin’ ‘https://myrepo.visualstudio.com/repo’
15:47:34.823061 run-command.c:626 trace: run_command: ‘git-remote-https’ ‘origin’ ‘https://myrepo.visualstudio.com/repo’
15:47:38.170096 run-command.c:626 trace: run_command: ‘git credential-manager get’
15:47:38.234111 git.c:560 trace: exec: ‘git-credential-manager’ ‘get’
15:47:38.235099 run-command.c:626 trace: run_command: ‘git-credential-manager’ ‘get’
15:47:44.401753 run-command.c:626 trace: run_command: ‘git credential-manager erase’
15:47:44.463758 git.c:560 trace: exec: ‘git-credential-manager’ ‘erase’
15:47:44.464756 run-command.c:626 trace: run_command: ‘git-credential-manager’ ‘erase’
15:47:44.840772 git.c:328 trace: built-in: git ‘rev-parse’ ‘—git-dir’ ‘—is-inside-git-dir’ ‘—is-bare-repository’ ‘—is-inside-work-tree’ ‘—short’ ‘HEAD’

The text was updated successfully, but these errors were encountered:

whoisj commented Feb 1, 2018

Seems you know how to enable GIT_TRACE so that’s awesome. Please enable GCM_TRACE as well and we’ll find a way to get you unblocked asap.

gitp31415926 commented Feb 1, 2018

See the GCM Logs below. Thanks

18:53:12.566941 . \Common.cs:524 trace: [Main] git-credential-manager (v1.12.0) ‘get’
18:53:12.699950 . \Where.cs:239 trace: [FindGitInstallations] found 1 Git installation(s).
18:53:12.708950 . Configuration.cs:405 trace: [LoadGitConfiguration] git All config read, 38 entries.
18:53:12.714950 . \Where.cs:239 trace: [FindGitInstallations] found 1 Git installation(s).
18:53:12.715953 . Configuration.cs:405 trace: [LoadGitConfiguration] git All config read, 38 entries.
18:53:12.721951 . \Common.cs:461 trace: [LoadOperationArguments] http.proxy = ‘http://proxy:8080’.
18:53:12.722952 . tionArguments.cs:522 trace: [SetProxy] successfully set proxy to ‘http://proxy:8080/’.
18:53:12.750954 . \Common.cs:74 trace: [CreateAuthentication] detecting authority type for ‘https://myrepo.visualstudio.com/’.
18:53:12.760956 . uthentication.cs:137 trace: [DetectAuthority] ‘https://myrepo.visualstudio.com/’ is subdomain of ‘visualstudio.com’, checking AAD vs MSA.
18:53:12.834961 . uthentication.cs:139 trace: [GetAuthentication] not github.com, authentication creation aborted.
18:53:12.834961 . \Common.cs:169 trace: [CreateAuthentication] authority for ‘https://myrepo.visualstudio.com/’ is basic with NTLM=Auto.
18:53:13.008980 . uthentication.cs:132 trace: [AcquireCredentials] prompting user for credentials for ‘https://myrepo.visualstudio.com/’.
18:53:22.437114 . \Dialog.cs:99 trace: [DisplayModal] successfully acquired credentials from user.
18:53:22.441113 . seSecureStore.cs:210 trace: [WriteCredential] credentials for ‘git:https://myrepo.visualstudio.com’ written to store.
18:53:22.442114 . \Common.cs:556 trace: [QueryCredentials] credentials found.
18:53:22.975431 . \Common.cs:524 trace: [Main] git-credential-manager (v1.12.0) ‘erase’
18:53:23.097439 . \Where.cs:239 trace: [FindGitInstallations] found 1 Git installation(s).
18:53:23.106440 . Configuration.cs:405 trace: [LoadGitConfiguration] git All config read, 38 entries.
18:53:23.109439 . \Where.cs:239 trace: [FindGitInstallations] found 1 Git installation(s).
18:53:23.110446 . Configuration.cs:405 trace: [LoadGitConfiguration] git All config read, 38 entries.
18:53:23.118439 . \Common.cs:461 trace: [LoadOperationArguments] http.proxy = ‘http://proxy:8080’.
18:53:23.119441 . tionArguments.cs:522 trace: [SetProxy] successfully set proxy to ‘http://proxy:8080/’.
18:53:23.143451 . \Common.cs:74 trace: [CreateAuthentication] detecting authority type for ‘https://myrepo.visualstudio.com/’.
18:53:23.155446 . uthentication.cs:137 trace: [DetectAuthority] ‘https://myrepo.visualstudio.com/’ is subdomain of ‘visualstudio.com’, checking AAD vs MSA.
18:53:23.219455 . uthentication.cs:139 trace: [GetAuthentication] not github.com, authentication creation aborted.
18:53:23.220452 . \Common.cs:169 trace: [CreateAuthentication] authority for ‘https://myrepo.visualstudio.com/’ is basic with NTLM=Auto.
18:53:23.220452 . \Common.cs:189 trace: [DeleteCredentials] deleting basic credentials for ‘https://myrepo.visualstudio.com/’.
18:53:23.259450 . aseSecureStore.cs:59 trace: [Delete] credentials for ‘git:https://myrepo.visualstudio.com’ deleted from store.

Читайте также:  Windows setup api грузит процессор

whoisj commented Feb 1, 2018

Um. this is very wrong:

18:53:12.834961 . \Common.cs:169 trace: [CreateAuthentication] authority for ‘https://myrepo.visualstudio.com/’ is basic with NTLM=Auto.

Can you run git config —list —show-origin | findstr /I credential and share the output? Seems like you might have a config attempting to force GCM into basic authentication for visualstudio.com.

gitp31415926 commented Feb 1, 2018

Thanks a lot. That’s what I figured as well. Just don’t know where to look for such setting.

$ git config —list —show-origin | findstr /I credential
FINDSTR: Cannot open credential

The full git config output as per below:
file:»C:\ProgramData/Git/config» core.symlinks=false
file:»C:\ProgramData/Git/config» core.autocrlf=true
file:»C:\ProgramData/Git/config» core.fscache=true
file:»C:\ProgramData/Git/config» color.diff=auto
file:»C:\ProgramData/Git/config» color.status=auto
file:»C:\ProgramData/Git/config» color.branch=auto
file:»C:\ProgramData/Git/config» color.interactive=true
file:»C:\ProgramData/Git/config» help.format=html
file:»C:\ProgramData/Git/config» rebase.autosquash=true
file:»C:\Program Files\Git\mingw64/etc/gitconfig» http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
file:»C:\Program Files\Git\mingw64/etc/gitconfig» http.sslbackend=openssl
file:»C:\Program Files\Git\mingw64/etc/gitconfig» diff.astextplain.textconv=astextplain
file:»C:\Program Files\Git\mingw64/etc/gitconfig» filter.lfs.clean=git-lfs clean — %f
file:»C:\Program Files\Git\mingw64/etc/gitconfig» filter.lfs.smudge=git-lfs smudge — %f
file:»C:\Program Files\Git\mingw64/etc/gitconfig» filter.lfs.required=true
file:»C:\Program Files\Git\mingw64/etc/gitconfig» filter.lfs.process=git-lfs filter-process
file:»C:\Program Files\Git\mingw64/etc/gitconfig» credential.helper=manager
file:C:/Users/dli/.gitconfig http.proxy=http://proxy:8080
file:C:/Users/dli/.gitconfig https.proxy=http://proxy:8080
file:.git/config core.repositoryformatversion=0
file:.git/config core.filemode=false
file:.git/config core.bare=false
file:.git/config core.logallrefupdates=true
file:.git/config core.symlinks=false
file:.git/config core.ignorecase=true
file:.git/config remote.origin.url=https://myrepo.visualstudio.com/
file:.git/config remote.origin.fetch=+refs/heads/:refs/remotes/origin/
file:.git/config branch.master.remote=origin
file:.git/config branch.master.merge=refs/heads/master
file:.git/config gitflow.branch.master=master
file:.git/config gitflow.branch.develop=develop
file:.git/config gitflow.prefix.feature=feature/
file:.git/config gitflow.prefix.bugfix=bugfix/
file:.git/config gitflow.prefix.release=release/
file:.git/config gitflow.prefix.hotfix=hotfix/
file:.git/config gitflow.prefix.support=support/
file:.git/config gitflow.prefix.versiontag=
file:.git/config gitflow.path.hooks=D:/Source/myrepo/.git/hooks

whoisj commented Feb 1, 2018

Ah — oh, guh. Looks like another proxy issue.

The :8080 give me hopes that your proxy might be TFS. If it is, try your failing command using git -c http.sslBackend=schannel . It’ll either fail horribly (your Git is too old) or succeed. If it does succeed, you can make the http.sslBackend=schannel a permanent thing via git config —global http.sslBackend schannel .

Читайте также:  Linux mint установка драйверов wifi

We have fixes in the soon-ish to be released GCM v1.15 for handling proxies, hopefully that’ll help you.

gitp31415926 commented Feb 2, 2018

Still no luck using http.sslBackend=schannel

However I notice I can connect to my other repos on visualstudio.com using Live Account authentication. Looks like the issue is to do with AAD?

whoisj commented Feb 2, 2018

Sure does. I’ll need to ask around about this. Apologies for the delay.

whoisj commented Feb 2, 2018

One idea, have you tried GCM v1.14.0?

whoisj commented Feb 7, 2018

@gitp31415926 can try something (apologies for the slow reply, I’ve been buried). Try deleting the file %LocalAppData%\GitCredentialManager\tenant.cache , and then re-attempting you authentication with your AAD backed host.

gitp31415926 commented Feb 8, 2018

Yes. Have tried v1.14.0 and deleting tenant.cache, still no luck. Get the same error and same entries in logs.

gitp31415926 commented Feb 8, 2018

This is the GCM window shows up which is not the usual white background popup we see

Getting “fatal: Authentication failed” -error when sending git commands in Windows 10

After updating domain password, accessing git-repo is no longer possible. VS Code and Source Tree as well as Visual Studio are returning the following error message on pull, push, fetch etc..

Normally a credentials pop-up should appear however this is not happening. Also the common recommendation.

9 Answers 9

The password is stored in windows credential manager and needs to be updated. Open command prompt and enter the following command to view the list of stored passwords:

Scroll down in the list until you spot the git-related entries. Click it and edit the correct password.

I agree with Jesper, Other way to do is — On windows, if you can navigate to :

Control Panel\User Accounts\Credential Manager

Under Windows Credentials\Windows Vault page on Generic Credentials, you can update the password of existing GIT record or can also add new Generic Credentials.

Updated answer for Mac users :

In case if you’re here with similar issue on Mac, you can do similar thing in keychain access — by deleting the existing GIT record, & then if you pass your credentials again in git bash or any other tool a new record gets created, things should work.

Try the following:

  1. Click Start
  2. Type: Credential Manager
  3. See the Windows Credential Manager shortcut and double-click it to open the application.
  4. Once the app is open, click on the «Windows Credentials» tab.
  5. Locate the credentials that you want removed, they will start with «git:» and might begin with «ada:»
  6. Click on the credential entry, it will open a detail view of the entry.
  7. Click Remove and confirm removal when prompted.
Читайте также:  Linux what shell is running

I have experience a similar issue with Windows 10 and here’s how I have solved it:

  1. From Windows Search, type Credential Manager:

Open Credential Manager, and navigate to Windows Credential Tab:

You should see an entry for git credentials in Windows Credential Manager:

Here is the root cause, this git credentials is locally cached/saved to your local computer, and since we have changed our Active Directory password, it is currently out of synch.

  1. Click Edit, and change this to your new/changed Active Directory password (this password has to match your new/changed Active Directory password) :
  1. Save, it should work (does not require terminal or machine restart).

Lastly, if you do not have access to Credentials Manager (due to admin/security policy), you can force git to prompt for password by do a git pull from the specific repo by using username based repo url, e.g.

Note that, this is repo specific so you will have to do this each repo.

GIT Fatal error: Authentication failed in Visual Studio

As of today I’m getting errors when trying to use git commands with my repository in Azure-DevOps. The repositories sit in a project on DevOps that I can access with the same account and shows no sign of any recent changes to it. The steps I can take to reproduce it is:

  1. Open the command prompt and enter git fetch
  2. A window appears prompting for a login
  3. I click the account
  4. No password is prompted, but an e-mail arrives that a PAT has been created
  5. The command prompt yields an error

Things I’ve tried so far:

  • Restarting PC
  • Signing out and in on Visual Studio
  • Removing the .IdentityService folder
  • Removing and installing GIT
  • Removing and installing GIT For Windows in the Visual Studio Installer
  • Removing the cache folder %LOCALAPPDATA%\Microsoft\Team Foundation\7.0\Cache
  • Removing the cache folder %LOCALAPPDATA%\Microsoft\Team Foundation\8.0\Cache
  • Removing GIT and VS keys from the Credential Manager
  • Quite a few other things ‘fixes’ found online that did not solve my issue
  • GIT 2.21.0-64 bit
  • Visual Studio 2019

I’ve attempted using Visual Studio Code with the Azure Repos 1.149.2 extension and get the same error. It yields me the Microsoft page to enter my code for device login which it grants, but using git commands give me the same error messages.

I’ve also had my profile removed from the Azure DevOps environment and re-added without success.

Оцените статью