【问题标题】:How to resolve Tee clc authorization error如何解决 Tee clc 授权错误
【发布时间】:2020-09-10 11:14:15
【问题描述】:

我正在尝试为我现有的工作区运行 tf wrokspaces 命令,因此我可以在 jetbrains Rider 中使用它,如下所示 Jetbrains Rider Article

当我运行命令时,我总是得到以下错误,

"TF31003: Either you have not entered the necessary credentials or your user account does not have permission to connect to the Team Foundation Server at https://tfs.app.visualstudio.com/. Ask your server administrator to add the appropriate permissions to your account.

TF400813: The user 'Windows Live ID\xxxxxxxxxx' is not authorized to access this resource.
com.microsoft.tfs.core.exceptions.TFSAccessException: You do not have permission to access the server."

I have all the necessary permission(i.e. Administrator) on tfs server to run tf workspaces command. 

In the log file of tee clc,

"2020-09-10 16:14:13,252 INFO  [main] (com.microsoft.tfs.core.telemetry.TfsTelemetryHelper) Command Line Client v.14.134.0.201804261732
2020-09-10 16:14:13,252 INFO  [main] (com.microsoft.tfs.core.telemetry.TfsTelemetryHelper) AppInsights telemetry initialized
2020-09-10 16:14:13,252 INFO  [main] (com.microsoft.tfs.core.telemetry.TfsTelemetryHelper)     Developer Mode: false
2020-09-10 16:14:13,252 INFO  [main] (com.microsoft.tfs.core.telemetry.TfsTelemetryHelper)     Production Environment: true
2020-09-10 16:14:13,425 INFO  [main] (com.microsoft.alm.provider.UserPasswordCredentialProvider) Getting credential that works for uri: https://xxxxx.visualstudio.com/
2020-09-10 16:14:13,425 INFO  [main] (com.microsoft.alm.provider.UserPasswordCredentialProvider) Getting credential based on OAuth2 token
2020-09-10 16:14:13,426 INFO  [main] (com.microsoft.alm.auth.oauth.OAuth2Authenticator) Ready to launch browser flow to retrieve oauth2 token.
2020-09-10 16:14:13,426 INFO  [main] (com.microsoft.alm.auth.oauth.OAuth2Authenticator) Attempt to use oauth2-useragent provider: JavaFx
2020-09-10 16:14:13,427 INFO  [main] (com.microsoft.alm.auth.oauth.OAuth2Authenticator) Using oauth2-useragent providers to retrieve AAD token.
2020-09-10 16:14:52,003 INFO  [main] (com.microsoft.alm.provider.UserPasswordCredentialProvider) Username exist? true, password exists? true
2020-09-10 16:14:52,089 INFO  [main] (com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory) HttpClient configured for https://xxxxxx.visualstudio.com/, authenticating as OAuth2
2020-09-10 16:14:53,186 WARN  [main] (com.microsoft.tfs.core.httpclient.HttpMethodDirector) Unable to respond to any of these challenges: {bearer=Bearer authorization_uri=https://login.microsoftonline.com/12fb99fd-4c12-44fb-b3ce-a12ca5aadf63, tfs-federated=TFS-Federated}
2020-09-10 16:14:53,929 WARN  [main] (com.microsoft.tfs.core.TFSTeamProjectCollection) Error getting data provider
com.microsoft.tfs.core.exceptions.TFSAccessException: You do not have permission to access the server.

TF31003: Either you have not entered the necessary credentials or your user account does not have permission to connect to the Team Foundation Server at https://tfs.app.visualstudio.com/. Ask your server administrator to add the appropriate permissions to your account.

TF400813: The user 'Windows Live ID\xxxxx' is not authorized to access this resource.
    at com.microsoft.tfs.core.exceptions.mappers.TECoreExceptionMapper.map(TECoreExceptionMapper.java:84)
    at com.microsoft.tfs.core.exceptions.mappers.RegistrationExceptionMapper.map(RegistrationExceptionMapper.java:18)
    at com.microsoft.tfs.core.clients.registration.RegistrationData.newFromServer(RegistrationData.java:61)
    at com.microsoft.tfs.core.clients.registration.RegistrationClient.getRegistrationData(RegistrationClient.java:617)
    at com.microsoft.tfs.core.clients.registration.RegistrationClient.getRegistrationEntries(RegistrationClient.java:144)
    at com.microsoft.tfs.core.clients.registration.RegistrationClient.getRegistrationEntries(RegistrationClient.java:129)
    at com.microsoft.tfs.core.PreFrameworkServerDataProvider.findServiceLocation(PreFrameworkServerDataProvider.java:275)
    at com.microsoft.tfs.core.PreFrameworkServerDataProvider.locationForCurrentConnection(PreFrameworkServerDataProvider.java:251)
    at com.microsoft.tfs.core.TFSTeamProjectCollection.getServerDataProvider(TFSTeamProjectCollection.java:172)
    at com.microsoft.tfs.core.TFSConnection.getWebService(TFSConnection.java:903)
    at com.microsoft.tfs.core.config.client.DefaultClientFactory$7.newClient(DefaultClientFactory.java:208)
    at com.microsoft.tfs.core.config.client.DefaultClientFactory.newClient(DefaultClientFactory.java:86)
    at com.microsoft.tfs.core.TFSConnection.getClient(TFSConnection.java:1490)
    at com.microsoft.tfs.core.TFSTeamProjectCollection.getVersionControlClient(TFSTeamProjectCollection.java:376)
    at com.microsoft.tfs.client.clc.vc.commands.CommandWorkspaces.displayAndUpdate(CommandWorkspaces.java:295)
    at com.microsoft.tfs.client.clc.vc.commands.CommandWorkspaces.run(CommandWorkspaces.java:93)
    at com.microsoft.tfs.client.clc.Application.run(Application.java:306)
    at com.microsoft.tfs.client.clc.Application.run(Application.java:154)
    at com.microsoft.tfs.client.clc.vc.Main.main(Main.java:55)
2020-09-10 16:14:53,932 ERROR [main] (com.microsoft.tfs.client.clc.Application) An error occurred: You do not have permission to access the server.

TF31003: Either you have not entered the necessary credentials or your user account does not have permission to connect to the Team Foundation Server at https://tfs.app.visualstudio.com/. Ask your server administrator to add the appropriate permissions to your account.

TF400813: The user 'Windows Live ID\xxxxxxxx' is not authorized to access this resource.
com.microsoft.tfs.core.exceptions.TFSAccessException: You do not have permission to access the server.

TF31003: Either you have not entered the necessary credentials or your user account does not have permission to connect to the Team Foundation Server at https://tfs.app.visualstudio.com/. Ask your server administrator to add the appropriate permissions to your account.

TF400813: The user 'Windows Live ID\xxxxxxxx' is not authorized to access this resource.
    at com.microsoft.tfs.core.exceptions.mappers.TECoreExceptionMapper.map(TECoreExceptionMapper.java:84)
    at com.microsoft.tfs.core.exceptions.mappers.RegistrationExceptionMapper.map(RegistrationExceptionMapper.java:18)
    at com.microsoft.tfs.core.clients.registration.RegistrationData.newFromServer(RegistrationData.java:61)
    at com.microsoft.tfs.core.clients.registration.RegistrationClient.getRegistrationData(RegistrationClient.java:617)
    at com.microsoft.tfs.core.clients.registration.RegistrationClient.getRegistrationEntries(RegistrationClient.java:144)
    at com.microsoft.tfs.core.clients.registration.RegistrationClient.getRegistrationEntries(RegistrationClient.java:129)
    at com.microsoft.tfs.core.PreFrameworkServerDataProvider.findServiceLocation(PreFrameworkServerDataProvider.java:275)
    at com.microsoft.tfs.core.PreFrameworkServerDataProvider.locationForCurrentConnection(PreFrameworkServerDataProvider.java:251)
    at com.microsoft.tfs.core.TFSTeamProjectCollection.getServerDataProvider(TFSTeamProjectCollection.java:172)
    at com.microsoft.tfs.core.TFSConnection.getWebService(TFSConnection.java:903)
    at com.microsoft.tfs.core.config.client.DefaultClientFactory$7.newClient(DefaultClientFactory.java:208)
    at com.microsoft.tfs.core.config.client.DefaultClientFactory.newClient(DefaultClientFactory.java:86)
    at com.microsoft.tfs.core.TFSConnection.getClient(TFSConnection.java:1490)
    at com.microsoft.tfs.core.TFSTeamProjectCollection.getVersionControlClient(TFSTeamProjectCollection.java:376)
    at com.microsoft.tfs.client.clc.vc.commands.CommandWorkspaces.displayAndUpdate(CommandWorkspaces.java:295)
    at com.microsoft.tfs.client.clc.vc.commands.CommandWorkspaces.run(CommandWorkspaces.java:93)
    at com.microsoft.tfs.client.clc.Application.run(Application.java:306)
    at com.microsoft.tfs.client.clc.Application.run(Application.java:154)
    at com.microsoft.tfs.client.clc.vc.Main.main(Main.java:55)
2020-09-10 16:14:53,933 INFO  [main] (com.microsoft.tfs.client.clc.vc.Main) Shutting down
2020-09-10 16:14:53,934 INFO  [main] (com.microsoft.tfs.client.clc.vc.Main) Has shut down"

为了验证 tee clc 是否已安装并正常工作,我创建了新组织并运行相同的工作区命令。它适用于新组织。同样来自visual studio,我可以毫无问题地使用我现有的工作区。

你能帮忙解决授权问题吗?

谢谢!

【问题讨论】:

    标签: visual-studio tfs azure-devops rider tee


    【解决方案1】:

    要缩小问题范围,请检查以下项目:

    1. 检查您的组织是否支持 AAD,登录帐户是 Windows Live ID\xxxxxAAD\xxxxx

    2. 关闭所有 Visual Studio 实例,删除 %LOCALAPPDATA%\.IdentityService,并清除 DevOps 缓存 %LOCALAPPDATA%\Microsoft\Team Foundation\x.0\Cache

    3. 为这个组织/项目创建一个新的工作区,看看结果如何。

    【讨论】:

    • 我尝试了选项 2 和 3,结果相同。我检查了登录帐户是 AAD\xxxxx,因为它显示在 AAD/Member 上。问题是我的 windows live id 在组织 AAD 成员中注册。如何强制 tee clc 将我的 windows live id 作为 AAD/member 并且不作为 windows Live ID \xxxxx ?
    • 尝试以下项目: 1. 关闭所有浏览器,包括未运行 Azure DevOps 的浏览器。 2. 打开私人或隐身浏览会话。 3. 访问此 URL:aka.ms/vssignout。您会看到一条消息,上面写着“正在注销”。注销后,你将被重定向到 Azure DevOps @dev.azure.microsoft.com 网页。 4. 再次登录 Azure DevOps。选择您的其他身份。
    • 我按照你的步骤,结果还是一样。我仍然无法执行工作区命令。还有什么建议吗?我怎样才能找到实际的问题?无论如何我可以帮助您诊断这个问题吗?
    • 你能分享你的命令吗?您是否使用 OAuth 令牌来访问 DevOps?请使用 OAuth 令牌运行以下命令:tf workspaces /collection:https://dev.azure.com/xxx /loginType:OAuth /login:.,***.
    • 是的,当然。我正在执行命令:“tf.cmd workspaces -collection:xxxx.visualstudio.com”之后,浏览器窗口将打开询问用户名和密码。在浏览器窗口中,我可以看到它使用 OAuth2 作为身份验证类型。在该浏览器窗口自动关闭后,我收到错误消息。您还可以在我发布的有问题的 tee clc 日志中看到它清楚地表明使用了 Oauth2 身份验证并且成功。同样在工作区命令中,没有可用的 /LoginType 开关。
    猜你喜欢
    • 2020-01-24
    • 1970-01-01
    • 2019-08-23
    • 1970-01-01
    • 1970-01-01
    • 2021-06-13
    • 2020-09-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多