Search code examples
tfsvisual-studio-codeazure-devopstfvc

VS Code: login to TFS not with a password, but a smartcard


I'm trying to connect VS Code to our corporate TFS/TFVC.

When executing "Team: Signin", it asks for a username and password, which I don't have. I usually (also in Visual Studio) enter my corporate email address, then a dialog pops up where I can authenticate myself via smartcard.

I also tried to authenticate via token but I couldn't see where to enter it.

How can I successfully log in?


Solution

  • TFVC is just a kind of source control similar to Git. One is centralized and the other is distributed.

    So you should login to TFS not TFVC. According to your description, not able to use smart card to connect through VS code. This seems to be a known issue:

    Besides, Personal access tokens (PATs) are alternate passwords that you can use to authenticate into Azure DevOps. When use it, just leave the user name empty and enter password with PAT token.

    When you are using it, please navigate to https://tfsurl/{teamprojectcollection}/_usersSettings/tokens, and make sure your PAT is still in validity period. If not, please create new token by clicking 'New Token' button.


    Update

    But PAT is only work when you connect to Azure DevOps Service in VS code. If your repository is on Team Foundation Server 2015 Update 2 or later, you will be prompted to enter your username and password.

    Team Foundation Server

    If you are connecting to Team Foundation Server, you will only need your NTLM credentials (domain name, server name and password). It is assumed that you have the proper permissions on the TFS Server.

    For more details you could refer our official link with Authentication part: Azure Repos Extension for Visual Studio Code

    You could also take a look at this blog which also mention this point-- How to integrate TFS in Visual Studio Code