VS Code:不使用密码而是使用智能卡登录 TFS

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

我正在尝试将 VS Code 连接到我们的公司 TFS/TFVC。

执行"Team: Signin"时,它要求输入用户名和密码,我没有。我通常(也在 Visual Studio)输入我的公司电子邮件地址,然后会弹出一个对话框,我可以在其中通过智能卡验证自己。

我也试过通过令牌进行身份验证,但我看不到在哪里输入它。

如何才能成功登录?

TFVC 只是一种类似于Git 的源代码控制。一种是集中式,一种是分布式。

所以你应该登录到 TFS 而不是 TFVC。根据您的描述,无法使用智能卡通过 VS 代码进行连接。这似乎是一个已知问题:

此外,个人访问令牌 (PAT) 是备用密码,可用于对 Azure DevOps 进行身份验证。使用时,只需将用户名留空,然后输入带有PAT token的密码即可。

使用时,请导航至https://tfsurl/{teamprojectcollection}/_usersSettings/tokens,并确保您的PAT仍在有效期内。如果没有,请单击 'New Token' 按钮创建新令牌。


更新

但 PAT 仅在您在 VS 代码中连接到 Azure DevOps 服务时才有效。如果您的存储库位于 Team Foundation Server 2015 Update 2 或更高版本上,系统将提示您输入您的用户名和密码

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.

有关详细信息,您可以参考我们的官方 link 和 Authentication 部分:Azure Repos Extension for Visual Studio Code

你也可以看看这个博客,里面也提到了这一点-- How to integrate TFS in Visual Studio Code