代码之家  ›  专栏  ›  技术社区  ›  Saturnix

Visual Studio Community 2017,无法刷新帐户的凭据。如何修复?

  •  0
  • Saturnix  · 技术社区  · 6 年前

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

    enter image description here

    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'
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   Saturnix    6 年前

    通过打开开发人员命令提示符(开始菜单->开发人员命令提示符)并运行

    Set SERVICEHUBTRACELEVEL=Verbose
    devenv /log
    

    推荐文章