Wednesday, October 15, 2014

Fixing the "Authentication failed" Message When Accessing a TFS-Git Repository

Recently I've been working with a TFS Project using Git as the source control provider and something locally has gone wrong and I just couldn't remedy in VS.NET directly. The buzz and consensus already seems to be that managing your Git repository with one of the following tools is easier and more powerful than VS.NET IDE integration:
  • Git Bash
  • Git for Windows
  • TortoiseGit
  • SourceTree
  • Git Gui
I have used Subversion in the past so TortoiseGit was familiar already to me, but the others were not too hard to test out as well. The main goal of what I needed to do was a simple Git Pull to update my local repository to the most current version. I'm using a Windows LiveID to authenticate to the TFS Online Project just fine in VS2013 and made the original clone successfully.

VS2013 initially had no issue doing a Pull, but once things got messed up I decided to use an external tool to fix the problem. The issue is all the tools kept failing authentication with the following error in some flavor below. It didn't make sense because the credentials I was providing worked previously.

"Authentication failed"

Note - it's know that the VS IDE integration with Git does not expose all the functionality available, so if you get into a mess with your repo its probably not going to be easy to fix from VS.NET's tooling. 

It turns out the solution is to modify a setting on your Windows LiveID account to 'Enable alternate credentials'. You can reach this setting by clicking on your user name in the top left-hand corner once logged into your Live account, selecting 'My Profile', and then selecting the 'Credentials' heading.

Here you will need to click the link to 'Enable alternate credentials' and fill in a password, and secondary username if desired or if the application you use can't use an email address for a username:

This allows the use of basic authentication credentials and fixes the authentication issue with the tools I listed above to manage a Git repository. Make sure to use these credentials when authenticating and you should now be able to manage your TFS-Git repository without authentication issues.

1 comment:

  1. When will this be available for on premise installations? I don't have a credentials tab under the profile for TFS 2015 Update 1.