microsoft / Git-Credential-Manager-for-Windows

Secure Git credential storage for Windows with support for Visual Studio Team Services, GitHub, and Bitbucket multi-factor authentication.
Other
2.86k stars 590 forks source link

Since Windows update to version 19041.1 authentication does not work #879

Open totollygeek opened 4 years ago

totollygeek commented 4 years ago

Which Version of GCM are you using ? Git Credential Manager for Windows version 1.20.0

Which service are you trying to connect to

If you're using Azure DevOps, can you access the repository in the browser via the same URL?

Expected behavior When doing git pull, git push or git clone credentials stored in Credentials Manager to be used or if missing, to be prompted to enter them.

Actual behavior It just yields fatal: Authentication failed for 'MY TFS URL' It worked just fine before the Windows update on two of my machines. Same outcome afterwards. Even after clearing ALL the credentials in Windows Credentials Manager still does not ask me for my credentials, but just fails.

Set the env variables GCM_TRACE=1 and GIT_TRACE=1 and run your git command. Redact any private information and attach the log

11:15:59.396386 exec_cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin 11:15:59.396386 git.c:344 trace: built-in: git clone 'REDACTED' Cloning into 'REDACTED'... 11:15:59.448320 run-command.c:640 trace: run_command: git remote-https origin 'REDACTED' 11:15:59.463933 exec_cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core 11:15:59.463933 git.c:576 trace: exec: git-remote-https origin 'REDACTED' 11:15:59.463933 run-command.c:640 trace: run_command: git-remote-https origin 'REDACTED' 11:15:59.479543 exec_cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core 11:16:00.913859 run-command.c:640 trace: run_command: 'git credential-manager get' 11:16:01.083184 exec_cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core 11:16:01.083184 git.c:576 trace: exec: git-credential-manager get 11:16:01.083184 run-command.c:640 trace: run_command: git-credential-manager get 11:16:01.167610 ...\Common.cs:744 trace: [Main] git-credential-manager (v1.20.0) 'get' 11:16:01.236642 ...\Git\Where.cs:348 trace: [FindGitInstallations] found 1 Git installation(s). 11:16:01.236642 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 16 entries. 11:16:01.331571 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'REDACTED'. 11:16:01.336576 ...\Common.cs:224 trace: [CreateAuthentication] authority for 'REDACTED' is basic with NTLM=Auto. 11:16:01.336576 ...\Common.cs:765 trace: [QueryCredentials] querying 'Auto' for credentials. 11:16:01.352212 ...\Common.cs:780 trace: [QueryCredentials] credentials found. 11:16:02.602163 run-command.c:640 trace: run_command: 'git credential-manager erase' 11:16:02.639897 exec_cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core 11:16:02.639897 git.c:576 trace: exec: git-credential-manager erase 11:16:02.639897 run-command.c:640 trace: run_command: git-credential-manager erase 11:16:02.732291 ...\Common.cs:744 trace: [Main] git-credential-manager (v1.20.0) 'erase' 11:16:02.793290 ...\Git\Where.cs:348 trace: [FindGitInstallations] found 1 Git installation(s). 11:16:02.808915 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 16 entries. 11:16:02.871378 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'REDACTED'. 11:16:02.886996 ...\Common.cs:224 trace: [CreateAuthentication] authority for 'REDACTED' is basic with NTLM=Auto. 11:16:02.886996 ...\Common.cs:252 trace: [DeleteCredentials] deleting basic credentials for 'REDACTED'. 11:16:02.886996 ...aseSecureStore.cs:59 trace: [Delete] credentials not found for 'git:REDACTED'. fatal: Authentication failed for 'REDACTED'

totollygeek commented 4 years ago

Anybody have any idea on this one? I had to disable the manager and enter my credentials manually every time I interact with the remote...

PatrickKursawe commented 4 years ago

I had similar symptoms, but I could not access the repository at all from windows, only from the linux subsystem. Deleting the credentials from the windows credentials manager did not result in a prompt. Finally, I added the credentials manually: git:https://my.host.name as address, the username without any domain specification and the password. After that, it worked. Trace log from the last attempt that did not work looked this way: c:\Users\kursa\source\repos\Chronos>git pull 13:54:13.645220 ...\Common.cs:744 trace: [Main] git-credential-manager (v1.20.0) 'get' 13:54:13.712220 ...\Git\Where.cs:348 trace: [FindGitInstallations] found 1 Git installation(s). 13:54:13.718219 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 26 entries. 13:54:13.772220 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://devops.axelsemrau.de/'. 13:54:13.786219 ...\Common.cs:224 trace: [CreateAuthentication] authority for 'https://devops.axelsemrau.de/' is basic with NTLM=Auto. 13:54:13.787228 ...\Common.cs:765 trace: [QueryCredentials] querying 'Auto' for credentials. 13:54:13.892923 ...uthentication.cs:119 trace: [AcquireCredentials] 'https://devops.axelsemrau.de/' supports NTLM, sending NTLM credentials instead 13:54:13.893878 ...\Common.cs:780 trace: [QueryCredentials] credentials found. 13:54:14.058498 ...\Common.cs:744 trace: [Main] git-credential-manager (v1.20.0) 'erase' 13:54:14.124535 ...\Git\Where.cs:348 trace: [FindGitInstallations] found 1 Git installation(s). 13:54:14.130513 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 26 entries. 13:54:14.171534 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://devops.axelsemrau.de/'. 13:54:14.187534 ...\Common.cs:224 trace: [CreateAuthentication] authority for 'https://devops.axelsemrau.de/' is basic with NTLM=Auto. 13:54:14.190498 ...\Common.cs:252 trace: [DeleteCredentials] deleting basic credentials for 'https://devops.axelsemrau.de/'. 13:54:14.197533 ...aseSecureStore.cs:59 trace: [Delete] credentials not found for 'git:https://devops.axelsemrau.de'. 13:54:14.344087 ...\Common.cs:744 trace: [Main] git-credential-manager (v1.20.0) 'erase' 13:54:14.414122 ...\Git\Where.cs:348 trace: [FindGitInstallations] found 1 Git installation(s). 13:54:14.420092 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 26 entries. 13:54:14.461127 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://devops.axelsemrau.de/'. 13:54:14.478122 ...\Common.cs:224 trace: [CreateAuthentication] authority for 'https://devops.axelsemrau.de/' is basic with NTLM=Auto. 13:54:14.479090 ...\Common.cs:252 trace: [DeleteCredentials] deleting basic credentials for 'https://devops.axelsemrau.de/'. 13:54:14.486123 ...aseSecureStore.cs:59 trace: [Delete] credentials not found for 'git:https://devops.axelsemrau.de'. fatal: Authentication failed for 'https://devops.axelsemrau.de/Chromatographie/Chronos/_git/Chronos/' It looks like after leaving out the domain part, it did no longer try to use any NTLM related stuff. Took me "only" a day.

HughG commented 4 years ago

Anybody have any idea on this one? I had to disable the manager and enter my credentials manually every time I interact with the remote...

This might be a duplicate of one or more of #703, #750, and/or #793, but it's hard to tell because you've REDACTED the repo URL. If your original logs show that the "get" pass has no username in the URL, but your "delete" pass does, that points to it being similar. I have a similar problem and am about to go and add a comment on #703.

I'm on Windows 10 Pro Version 1909 build 18363.535, Git for Windows 2.24.1.windows.2, and GCM v1.20.0.

totollygeek commented 4 years ago

As it turns out, I am having issues even installing and removing the manager. When I use git credential-manager install/deploy I get this:

❯ git credential-manager install
11:40:45.953228 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
11:40:45.956226 git.c:703               trace: exec: git-credential-manager install
11:40:45.956226 run-command.c:662       trace: run_command: git-credential-manager install
11:40:46.075678 ...\Common.cs:744       trace: [Main] git-credential-manager (v1.20.0) 'install'

Looking for Git installation(s)...
11:40:46.108305 ...\Git\Where.cs:348    trace: [FindGitInstallations] found 1 Git installation(s).
  C:\Program Files\Git

Deploying from 'C:\Program Files\Git\mingw64\libexec\git-core' to 'C:\Program Files\Git'.
11:40:46.112371 ...\Installer.cs:817    trace: [CleanFiles] clean 'C:\Program Files\Git\mingw64\libexec\git-core\AzureDevOps.Authentication.dll'.
11:40:46.113359 ...\Installer.cs:831    trace: [CleanFiles] clean of 'C:\Program Files\Git\mingw64\libexec\git-core' failed.
11:40:46.116559 ...\Installer.cs:852    trace: [CopyFiles] copy 'AzureDevOps.Authentication.dll' from 'C:\Program Files\Git\mingw64\libexec\git-core' to 'C:\Program Files\Git\mingw64\libexec\git-core'.
11:40:46.119746 ...\Installer.cs:863    trace: [CopyFiles] ! error: 'The process cannot access the file 'C:\Program Files\Git\mingw64\libexec\git-core\AzureDevOps.Authentication.dll' because it is being used by another process.'.
11:40:46.121165 ...\Installer.cs:875    trace: [CopyFiles] copy failed.
11:40:46.122166 ...\Common.cs:709       trace: [LogEvent] Deployment to 'C:\Program Files\Git' failed.
  deployment failed. U_U

Press any key to continue...
11:40:46.127523 ...\Program.cs:328      trace: [Deploy] Installer result = 'DeploymentFailed', exit code = 2.
PatrickKursawe commented 4 years ago

Try using SysInternals Process Explorer to find which process uses that dll?

11:40:46.119746 ...\Installer.cs:863 trace: [CopyFiles] ! error: 'The process cannot access the file 'C:\Program Files\Git\mingw64\libexec\git-core\AzureDevOps.Authentication.dll' because it is being used by another process.'.

totollygeek commented 4 years ago

I tried that. I think that the git credential-manager itself is using it. I can't find any other process accessing it, besides the credential manager. Could this be a bug?

PatrickKursawe commented 4 years ago

Why are you trying to install it, when it is already installed?

totollygeek commented 4 years ago

I get the same error when I try to remove it. First I tried that. I thought that if I remove and deploy it again, it might fix it. => Nope. Then I reinstalled Git for Windows and check the "Enable Credentials Manager". => Same result Then I reinstalled Git for Windows and DID NOT check the "Enable Credentials Manager". Then I installed it manually using the setup provided here in the Releases section. => Same result I am running out of options...

totollygeek commented 4 years ago

Anybody have any idea on this one? I had to disable the manager and enter my credentials manually every time I interact with the remote...

This might be a duplicate of one or more of #703, #750, and/or #793, but it's hard to tell because you've REDACTED the repo URL. If your original logs show that the "get" pass has no username in the URL, but your "delete" pass does, that points to it being similar. I have a similar problem and am about to go and add a comment on #703.

I'm on Windows 10 Pro Version 1909 build 18363.535, Git for Windows 2.24.1.windows.2, and GCM v1.20.0.

The REDACTED URL looks something like that: https://tfs. MyOrg.com/tfs/collection1/someproject/_git/reponame

If that helps...

Smille02a commented 4 years ago

Its already installed on GitHub. I'm trying to clone it so I can operate it on Visual Studio. None of them work. And I've tried a variety of your solution suggestions.

Visual Studio 201 (Community), fully patched, throws this:

Git failed with a fatal error. unable to access 'https://github.com/Smille02a/Hello-World2020/': error setting certificate verify locations: CAfile: c:/program files (x86)/microsoft visual studio/2019/community/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/bin/curl-ca-bundle.crt CApath: none

Even on the simplest repository you could create and then try to import.

-- Best Regards,

Stephen Miller BSEng, EE swmps@yahoo.com

smille02@msn.com

Text_Me/smille02https://line2text.me/smille02 Cell: 917.704.5934 | Fax: 212.225.8247 | VoIP 303.500.3820 | @Smille02 to Twitter www.linkedin.com/in/swmpshttp://www.linkedin.com/in/swmps

On Tuesday, January 21, 2020, 5:29:35 AM EST, Patrick Kursawe notifications@github.com wrote:

Why are you trying to install it, when it is already installed?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FGit-Credential-Manager-for-Windows%2Fissues%2F879%3Femail_source%3Dnotifications%26email_token%3DAG4WKJAHXG6GDCINJEJU5N3Q63FA3A5CNFSM4J5AQRN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJPH5WY%23issuecomment-576618203&data=02%7C01%7C%7C122212ee0a154e956e9408d79e5cceef%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637151993751982005&sdata=oqvdOvVSWn8%2FKR240z%2F1XYprN4JwFgJeHhx305LweoU%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAG4WKJHFVZVJBM5HH7JWKL3Q63FA3ANCNFSM4J5AQRNQ&data=02%7C01%7C%7C122212ee0a154e956e9408d79e5cceef%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637151993751982005&sdata=SMMd3PY%2Bl2OEcscSWgYHUF5CzKNRCAm7UmRYVFVtewI%3D&reserved=0.

PatrickKursawe commented 4 years ago

Go to team explorer->settings->git->global settings and check the cryptographic network provider. I guess you have OpenSSL or unset there? Try changing it to Secure Channel.

Smille02a commented 4 years ago

Global Git n VS, Yes! set to unset, I've changed it to secure channel

Thak you Sir! (testing...)

-- Best Regards,

Stephen Miller BSEng, EE swmps@yahoo.com

smille02@msn.com

Text_Me/smille02https://line2text.me/smille02 Cell: 917.704.5934 | Fax: 212.225.8247 | VoIP 303.500.3820 | @Smille02 to Twitter www.linkedin.com/in/swmpshttp://www.linkedin.com/in/swmps

On Wednesday, January 22, 2020, 2:12:34 AM EST, Patrick Kursawe notifications@github.com wrote:

Go to team explorer->settings->git->global settings and check the cryptographic network provider. I guess you have OpenSSL or unset there? Try changing it to Secure Channel.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FGit-Credential-Manager-for-Windows%2Fissues%2F879%3Femail_source%3Dnotifications%26email_token%3DAG4WKJD3HNVB3ZZPXOYJYO3Q67WWBA5CNFSM4J5AQRN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJSPDAA%23issuecomment-577040768&data=02%7C01%7C%7C907c46c1b60f44efb48a08d79f0a73bb%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637152739540857409&sdata=ny0dwrHtmv1VTwNoop1sSnpp0QAUTaa9lgnZHBSORSU%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAG4WKJDMK3C3CRF6XPHLYYDQ67WWBANCNFSM4J5AQRNQ&data=02%7C01%7C%7C907c46c1b60f44efb48a08d79f0a73bb%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637152739540867401&sdata=UNTRrD0djxvR12%2Fs51CdtRuaNeth2OfSTkjuhrjosFE%3D&reserved=0.

totollygeek commented 4 years ago

Go to team explorer->settings->git->global settings and check the cryptographic network provider. I guess you have OpenSSL or unset there? Try changing it to Secure Channel.

O.M.G!!!! That worked!!!! You should write that as a tutorial somewhere on the main README.md. Maybe handle the exception better to recognize that?

PatrickKursawe commented 4 years ago

Well, I'm not involved with the project, I'm just a user like you. And, AFAIK, there are valid use cases for the other provider.