[英]TFS git clone using Visual Studio 2015 gives 401 unauthorized error
Same problem here: Error encountered while cloning the remote repository with VS 2015 Update 3 (TFS 2015 Update 3) 此处存在同样的问题: 使用VS 2015 Update 3克隆远程存储库时遇到错误(TFS 2015 Update 3)
But that solution doesn't work for me.
但是这个解决方案对我不起作用。 Please read the full question.
请阅读完整的问题。
I received the following error when I tried to clone TFS git repository: 我尝试克隆TFS git存储库时收到以下错误:
Error encountered while cloning: An error occurred while sending the
request.
Inner Exception:
The remote server returned an error: (401) Unauthorized.
Inner Exception:
No credentials are available in the security package
I did not find any other log details. 我没有找到任何其他日志详细信息。
I verified that I am able to access TFS repository on the web . 我验证了我能够访问网络上的 TFS存储库。 I can also clone using Git bash .
我也可以使用Git bash进行克隆。 So it seems to be a problem with Visual Studio storing my credentials.
因此,Visual Studio存储我的凭据似乎存在问题。
as per the solution mentioned here , I don't want to delete all credentials for different TFS servers I am connected to. 根据这里提到的解决方案,我不想删除我连接到的不同TFS服务器的所有凭据。
First two works fine, I can any time switch to those accounts from Team Explorer but the 3rd one is not working. 前两个工作正常,我可以随时从团队资源管理器切换到这些帐户,但第三个不起作用。
Not sure, how to trouble-shoot it 不确定,如何解决问题
401 Unauthorized:
401未经授权:
If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials.
如果请求已包含授权凭据,则401响应表示已拒绝授权这些凭据。
Just as your guess, this may be a problem with Visual Studio storing my credentials. 正如您的猜测,这可能是Visual Studio存储我的凭据的问题。 You could first give a try with clear VS cache .
您可以先尝试使用清除VS缓存 。
If it's not work, you may need to change the account info which cached in VS for your company's TFS credentials. 如果它不起作用,您可能需要更改VS中缓存的帐户信息,以获取公司的TFS凭据。 Unlike VSTS, you can't switch user or log out directly for on-premise TFS.
与VSTS不同,您无法直接切换用户或注销内部部署TFS。
You have to delete the account info in Windows-Control Panel- Credential Manager . 您必须在Windows控制面板 - 凭据管理器中删除帐户信息。 You could give a try with only deleting the company's TFS credentials which based on TFS link address.
您可以尝试仅删除基于TFS链接地址的公司TFS凭证。
You may have to remove any tfs related credentials if it's still not working. 如果仍然无效,您可能必须删除任何与tfs相关的凭据。 No need to worry about other two servers, what you have to do is just re-entering your account info/password for them.
无需担心其他两台服务器,您只需重新输入您的帐户信息/密码即可。
Finally this is how I resolved the issue 最后,这就是我解决问题的方法
In my case i was connecting to TFS from my TEST domain where NETBIOS name matched but fully qualified name was different. 在我的情况下,我从我的TEST域连接到TFS,其中NETBIOS名称匹配,但完全限定名称是不同的。
When logging in with NETBIOS\\username it failed auth. 使用NETBIOS \\ username登录时,验证失败。 when logging in with FQDN\\username it succeeded.
使用FQDN \\ username登录时,它成功了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.