Git访问TFS出现权限不足(Using Personal Access Tokens to access Visual Studio Online)

Posted 天也冷了

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Git访问TFS出现权限不足(Using Personal Access Tokens to access Visual Studio Online)相关的知识,希望对你有一定的参考价值。

使用GIT克隆TFS服务器上的代码到本地时出现错误如下:

fatal: Authentication failed for \'https://***.visualstudio.com/***Project/_git/***/\'

解决办法:

原文请查看(https://roadtoalm.com/2015/07/22/using-personal-access-tokens-to-access-visual-studio-online/)

People who use Visual Studio Online for a while are probably familiar with the alternate credentials. These are used when accessing the REST API or when using an external client for accessing your Git repositories.

You configure your alternate credentials on your [My Profile] page and fill a username and password of your choice.

Once you enable your credentials, you can use these credentials when doing a REST call or (easier to test) clone a Git repository

This is great but not the most secure way of doing things.

 

Personal Access Tokens

In the update of July 7th, we now have the ability to use Personal Access Tokens as an alternative to the Alternate Credentials. Instead of sending our username and password over the wire we an now use a secure token that we can scope to a timeframe and to functionality within VSO. On the [My Profile] page you can configure one or more Personal Access Tokens. For example a token to access Code Features.

When you create the token, you see a token (only visible after creation !) that you should copy and keep safe.

This token alone is sufficient to authenticate against VSO. So when you now clone a Git repository you only have to fill in this token in the password box. Username can be empty or any value

The great thing is that you can revoke rights or the token afterwards and make sure that people cannot access stuff anymore.

Hope this helps!

以上是关于Git访问TFS出现权限不足(Using Personal Access Tokens to access Visual Studio Online)的主要内容,如果未能解决你的问题,请参考以下文章

TFS 2012 配置访问被拒绝:[用户名] 需要以下权限才能执行此操作:查看集合级别信息

Ubuntu系统中连接TFS的Git地址注意事项

重写Azure DevOps Server (TFS)中的Git版本记录

在 powershell 中运行时出现 Git-Tfs 错误。 “检索 LoaderExceptions”

用于撤销项目集合管理员某些权限的 TFS 访问权限

Azure DevOps Server:Git权限设置