简体   繁体   English

使用Visual Studio 2015的TFS git clone提供了401个未经授权的错误

[英]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服务器的所有凭据。

  1. I have https://tfs.CodePlex.com/tfs TFS credentials 我有https://tfs.CodePlex.com/tfs TFS凭据
  2. I have my personal https://myAccountName.VisualStudio.com credentials and 我有我的个人https://myAccountName.VisualStudio.com凭据和
  3. I am now connected to my company's tfs http://ipAddress:8080/tfs credentials 我现在连接到我公司的tfs http:// ipAddress:8080 / 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 最后,这就是我解决问题的方法

  1. TFS site was using only NTML authentication I added Negotiate on top it and removed anonymous access . TFS站点仅使用NTML身份验证我在其上添加了Negotiate并删除了匿名访问
  2. I had a second issue not able to access the TFS site via domain name and was only accessble via IP address. 我有第二个问题,无法通过域名访问TFS网站,只能通过IP地址访问。 To enable domain name access instead of IP address, I added registry keys for “ DisableStrictNameChecking ” and “ DisableLoopbackCheck ”. 为了启用域名访问而不是IP地址,我添加了“ DisableStrictNameChecking ”和“ DisableLoopbackCheck ”的注册表项。

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.

相关问题 Visual Studio 2015 - Git Fetch 返回远程服务器返回错误:(401) 未经授权 - Visual Studio 2015 - Git Fetch return The remote server returned an error: (401) Unauthorized Visual Studio 2015和git中的TFS - TFS in visual studio 2015 and git 在BitBucket上使用NetBeans + Git的401未经授权的错误 - 401 Unauthorized error using NetBeans + Git on BitBucket Visual Studio 2015和Git / TFS:Sync-Page-Error:找不到对象 - 没有匹配的松散对象 - Visual Studio 2015 and Git/TFS: Sync-Page-Error: Object not found - no matching loose object Visual Studio在连接时使用TFS GIT错误 - Visual Studio using TFS GIT error when connecting TFS Git存储库无法在Visual Studio 2015中同步 - TFS Git repository fails to sync in Visual Studio 2015 Git + Eclipse:401未经授权的错误 - Git + Eclipse: 401 Unauthorized Error 使用Visual Studio 2015 / TFS 2015将项目从Codeplex / TFS传输到SourceForge / Git - Transfert project from Codeplex/TFS to SourceForge/Git with Visual Studio 2015 / TFS 2015 TFS上的Visual Studio 2017推送错误(使用GIT联机运行Visual Studio) - Visual Studio 2017 push error on TFS (visual studio online with GIT) 在Visual Studio Online Git项目中使用Visual Studio 2015的问题 - Issues using Visual Studio 2015 with Visual Studio Online Git project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM