Recently, I had to authenticate to Team Foundation Server using an account with greater permissions to perform some administrative tasks. As you may know, this requires entering alternate credentials when you add the server to the list of TFS servers, or when you need to connect to the server. Once you’ve connected once, you aren’t prompted again as the credentials are cached locally.
In the past, to remedy this, you could simply delete the local TFS cache, which is located in the following directory (Windows Vista and onwards):
<system drive>\Users\<your profile>\AppData\Microsoft\Team Foundation
However, in more recent versions this has changed somewhat, and the user’s credentials are no longer linked to the local TFS cache or configuration.
Where are the Credentials?
Good question. After some digging about, it seems that the credentials are now stored in the user’s Credential Manager store within Windows. If you aren’t familiar with this, it was introduced on the more recent versions of Windows, and it lives via the Control Panel, under the following path: Control Panel->User Accounts
Inside this location, you can view all the locally cached credentials, including Windows Credentials:
Note: that it appears that for TFS credentials used by Team Explorer and other applications, the credentials are the ones under “Generic Credentials” not under “Windows Credentials” (in case you have TFS entries in both).
To modify or remove the credentials you use to connect to TFS, simply expand the appropriate entry and click on “Edit”, or to delete the local credentials, click on “Remove”. If you opt to remove the credentials, you’ll be prompted to enter new credentials next time you connect to the specified TFS server.
So that was a little out of the way. When I tested this, I made sure that I’d disconnected from TFS before changing/removing the credential configuration.
It would be nice if Team Explorer linked to the Credentials Manager so we didn’t have to go digging to work this out, wouldn’t it?