【问题标题】:Visual Studio Community 2017, we could not refresh the credentials for the account. How to fix?Visual Studio Community 2017,我们无法刷新帐户的凭据。怎么修?
【发布时间】:2018-09-27 20:53:19
【问题描述】:

我无法登录 Visual Studio Community 2017。如果我输入我的 Microsoft 凭据,则会弹出此消息:

我已经尝试过类似问题中列出的每一件事:Visual Studio 2017 - How to fix error: We could not refresh the credentials for the account

但它们不起作用(尝试删除 IdentityService 文件夹内容和文件夹本身;尝试通过安装程序修复)或无法完成(我无法访问“帮助”项菜单:没有登录整个应用程序被锁定)。

日志文件进入

我该如何解决这个问题? C:\Users\user\AppData\Local\Temp\servicehub\logs\AadAccountProviderService-10304-v05lxa0n-1 显示:

09/27/2018 14:37:56 : Error : There was a problem getting the access token using the prompt with UI flow. Error: 'Microsoft.IdentityService.Clients.ActiveDirectory.AdalServiceException: AADSTS70002: Error validating credentials. AADSTS40016: The identity provider returned an error. The status returned was 'BadRequest' and the message was '{"error":"invalid_grant","error_description":"The user could not be authenticated or the grant is expired. The user must first sign in and if needed grant the client application access to the requested scope."}'.
Trace ID: fd00d736-cee6-4093-bce8-0aa4fff7c900
Correlation ID: 0dfc7dad-cb24-4b7f-9a9b-f926f9f7b493
Timestamp: 2018-09-27 12:37:56Z
   at Microsoft.IdentityService.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.VerifyAuthorizationResult()
   at Microsoft.IdentityService.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.<PreTokenRequest>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.IdentityService.Clients.ActiveDirectory.AcquireTokenHandlerBase.<RunAsync>d__57.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityService.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenCommonAsync>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityService.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenAsync>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Developer.IdentityService.AccountProvider.NetworkServicesImpl.<AcquireTokenWithPromptInternalAsync>d__21.MoveNext()
    ErrorCode: invalid_grant
    StatusCode: 0'
09/27/2018 14:37:56 : Error : CreateAccount: Creating an account. QueryParameters 'site_id=501454&display=popup&nux=1&lc=1033'
Account creation failed. 
Error: 'Microsoft.IdentityService.Clients.ActiveDirectory.AdalServiceException: AADSTS70002: Error validating credentials. AADSTS40016: The identity provider returned an error. The status returned was 'BadRequest' and the message was '{"error":"invalid_grant","error_description":"The user could not be authenticated or the grant is expired. The user must first sign in and if needed grant the client application access to the requested scope."}'.
Trace ID: fd00d736-cee6-4093-bce8-0aa4fff7c900
Correlation ID: 0dfc7dad-cb24-4b7f-9a9b-f926f9f7b493
Timestamp: 2018-09-27 12:37:56Z
   at Microsoft.IdentityService.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.VerifyAuthorizationResult()
   at Microsoft.IdentityService.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.<PreTokenRequest>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.IdentityService.Clients.ActiveDirectory.AcquireTokenHandlerBase.<RunAsync>d__57.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityService.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenCommonAsync>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.IdentityService.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenAsync>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Developer.IdentityService.AccountProvider.NetworkServicesImpl.<AcquireTokenWithPromptInternalAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Developer.IdentityService.AccountProvider.AadAccountProviderService.<CreateAccountAsync>d__25.MoveNext()
    ErrorCode: invalid_grant
    StatusCode: 0'

【问题讨论】:

    标签: visual-studio-2017


    【解决方案1】:

    通过打开开发人员命令提示符(开始菜单 -> 开发人员命令提示符)并运行来解决此问题

    Set SERVICEHUBTRACELEVEL=Verbose
    devenv /log
    

    这启动了 Visual Studio,我可以从那里登录。出于某种原因,我忽略了这并没有导致错误消息。

    【讨论】:

      猜你喜欢
      • 2017-12-29
      • 2018-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-29
      • 1970-01-01
      相关资源
      最近更新 更多