Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Login failed when trying to perform git push to Azure Devops

I am on a Windows 10 machine, and this morning my git credentials were working as expected, and I was busy pushing and pulling code to our Azure Devops project. Now I cannot, from this specific VM anyways. When I do git pull I get the standard MS authentication prompt, and I can see my MS account (which is connected to windows via our federated AD)

enter image description here I click on my account, and the prompt goes away, and I get an error in my prompt:

Logon failed, use ctrl+c to cancel basic credential prompt. Password for 'https://[email protected]':

If I enter my AD password (or anything else) I get a authentication failed message. I also tried to re-enter my credentials by selecting "Use another account" in the MS sign in window, and I get the same results.

I have seen issues that were solved by removing the cached credentials from the Credential Manager. So I go Control Panel -> Credential Manager and remove all of the credentials that are stored and try the git operation again.

I get the same MS login window, and oddly enough my account is still there, and Connected to windows (and fails the same way when I click on it)

So then I removed my accounts that were associated via Settings -> Accounts -> Access work or school. I could see my MS account there, so that looked promising, but same behaviour. I tried to update git (it is v2.21.0.windows.1) I also installed microsoft's git credential manager as per some answers that I found on SO and microsoft's forums. Still getting the same error.

I rebooted and removed all the credentials/accounts again, then tried from Visual Studio instead of calling git from the command line.

Same error!

My next steps are to rebuild my Windows profile which I am hoping will reset all this stuff. I am able to access the site from another VM, so it seems to be some sort of git configuration/cached credentials on this machine.

Any assistance/ideas are appreciated.

like image 881
Brandon McClure Avatar asked Mar 28 '19 21:03

Brandon McClure


1 Answers

I had this issue when moving my DevOps organisation to a different tenant. The only thing that resolved my issue was to remove the tenant.cache file from the GitCredManager, see:

If you use Visual Studio or the Git command-line tool, you might need to clear the cache for the Git Credential Manager. Deleting the %LocalAppData%\GitCredentialManager\tenant.cache file on each client machine resolves the issue.

from https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/connect-organization-to-azure-ad?view=azure-devops

like image 89
Castrohenge Avatar answered Nov 06 '22 16:11

Castrohenge