Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

GCM does not recover from reset passwordΒ #793

@sergiopereira

Description

@sergiopereira

Me and a few others that work together have been experiencing a recurring authentication problem when using GCM. We use TFS 2018 hosted inside our corporate network. Pretty much every time we have to change our network password we start getting authentication errors from TFS, sometimes even after removing every entry from the Windows Credential Manager (WCM) that contained a reference to the TFS server, sometimes a reboot fixes things, sometimes it doesn't.

In my particular situation I log into Windows using a local admin account, connect to VPN, and authenticate with the corporate network as needed, when servers prompt me for my network creds. I have the Git credential config like so:

credential.helper=manager
credential.modalprompt=true

I turned GCM_TRACE on and this is what happens on a git fetch origin (I had no relevant entries in WCM):

14:06:25.219217 ...\Common.cs:744       trace: [Main] git-credential-manager (v1.18.1) 'get'
14:06:25.291325 ...\Git\Where.cs:348    trace: [FindGitInstallations] found 1 Git installation(s).
14:06:25.306958 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 90 entries.
14:06:25.306958 ...\Common.cs:513       trace: [LoadOperationArguments] modalPrompt = 'True'.
14:06:25.369461 ...\Common.cs:85        trace: [CreateAuthentication] detecting authority type for 'http://tfs2018.internal.mycorp.com:8181/'.
14:06:25.621691 ...\Common.cs:224       trace: [CreateAuthentication] authority for 'http://tfs2018.internal.mycorp.com:8181/' is basic with NTLM=Auto.
14:06:25.621691 ...\Common.cs:765       trace: [QueryCredentials] querying 'Auto' for credentials.
14:06:25.765221 ...uthentication.cs:119 trace: [AcquireCredentials] 'http://tfs2018.internal.mycorp.com:8181/' supports NTLM, sending NTLM credentials instead
14:06:25.765221 ...\Common.cs:780       trace: [QueryCredentials] credentials found.
14:06:26.146879 ...\Common.cs:744       trace: [Main] git-credential-manager (v1.18.1) 'erase'
14:06:26.239192 ...\Git\Where.cs:348    trace: [FindGitInstallations] found 1 Git installation(s).
14:06:26.239192 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 90 entries.
14:06:26.254817 ...\Common.cs:513       trace: [LoadOperationArguments] modalPrompt = 'True'.
14:06:26.309667 ...\Common.cs:85        trace: [CreateAuthentication] detecting authority type for 'http://tfs2018.internal.mycorp.com:8181/'.
14:06:26.534792 ...\Common.cs:224       trace: [CreateAuthentication] authority for 'http://tfs2018.internal.mycorp.com:8181/' is basic with NTLM=Auto.
14:06:26.534792 ...\Common.cs:252       trace: [DeleteCredentials] deleting basic credentials for 'http://tfs2018.internal.mycorp.com:8181/'.
14:06:26.534792 ...aseSecureStore.cs:59 trace: [Delete] credentials not found for 'git:http://tfs2018.internal.mycorp.com:8181'.
fatal: Authentication failed for 'http://tfs2018.internal.mycorp.com:8181/tfs/MyCollection/MyProject/_git/MyRepo/' 

Shouldn't GCM prompt me for credentials after failing via NTLM? It seems stuck in this scenario where it detects NTLM support, fails, deletes (or tries to delete) old credentials, and doesn't fall back to Basic auth.

During experimentation, I set credential.tfs2018.internal.mycorp.com.authority to Basic and that makes me get prompted for credentials (in the console, not with the modal pop-up.):

14:23:16.206867 ...\Common.cs:744       trace: [Main] git-credential-manager (v1.18.1) 'get'                                                                         
14:23:16.290617 ...\Git\Where.cs:348    trace: [FindGitInstallations] found 1 Git installation(s).                                                                   
14:23:16.290617 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 92 entries.                                                               
14:23:16.290617 ...\Common.cs:435       trace: [LoadOperationArguments] authority = 'Basic'.                                                                         
14:23:16.306253 ...\Common.cs:513       trace: [LoadOperationArguments] modalPrompt = 'True'.                                                                        
14:23:16.368745 ...\Common.cs:224       trace: [CreateAuthentication] authority for 'http://tfs2018.internal.mycorp.com:8181/' is basic with NTLM=Never.         
14:23:16.368745 ...\Common.cs:765       trace: [QueryCredentials] querying 'Basic' for credentials.                                                                  
14:23:16.384369 ...uthentication.cs:129 trace: [AcquireCredentials] prompting user for credentials for 'http://tfs2018.internal.mycorp.com:8181/'.               
14:23:32.608998 ...\Dialog.cs:103       trace: [DisplayModal] successfully acquired credentials from user.                                                           
14:23:32.624624 ...\Common.cs:780       trace: [QueryCredentials] credentials found.                                                                                 
14:23:33.305003 ...\Common.cs:744       trace: [Main] git-credential-manager (v1.18.1) 'store'                                                                       
14:23:33.383125 ...\Git\Where.cs:348    trace: [FindGitInstallations] found 1 Git installation(s).                                                                   
14:23:33.402945 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 92 entries.                                                               
14:23:33.411407 ...\Common.cs:435       trace: [LoadOperationArguments] authority = 'Basic'.                                                                         
14:23:33.411407 ...\Common.cs:513       trace: [LoadOperationArguments] modalPrompt = 'True'.                                                                        
14:23:33.462733 ...\Common.cs:224       trace: [CreateAuthentication] authority for 'http://CORP\[email protected]:8181/' is basic with NTLM=Ne
ver.                                                                                                                                                                 
14:23:33.462733 ...\Program.cs:513      trace: [Store] storing basic credentials for 'http://CORP\[email protected]:8181/'. 

This works and continues working without further prompts but I'm not sure there's some underlying problem that I'm just masking by doing this. I could maybe just ask all my team members to configure that last setting like I did but it doesn't seem reasonable. My expectation was that this kind of stuff should work transparently and auto-recover in scenarios like password reset.

Let me know if I can provide extra details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions