quinta-feira, 20 de novembro de 2014

SharePoint 2013 - Workflow suspenso: HTTP 401 Invalid JWT token



O fluxo de trabalho no SharePoint 2013 fica normalmente no estado suspenso com a mensagem de erro "HTTP 401 Invalid JWT token. Could not resolve issuer token." após a re-instalação do Workflow Manager. A causa é um token de autenticação (S2S - server to server autentication) inválido.

Mensagem de erro no interface:
An unhandled exception occurred during the execution of the workflow instance. Exception details: HTTP 401 {"error_descritption":Invalid JWT token. Could not resolve issuer token."}
Mensagem de error nos logs do SharePoint:

Application Authentication    High    SPApplicationAuthenticationModule: Invalid token or signature. Exception: System.IdentityModel.Tokens.SecurityTokenException: Invalid JWT token. Could not resolve issuer token.     at Microsoft.IdentityModel.S2S.Tokens.JsonWebSecurityTokenHandler.ReadTokenCore(String token, Boolean isActorToken)     at Microsoft.IdentityModel.S2S.Tokens.JsonWebSecurityTokenHandler.ReadActor(IDictionary`2 payload)     at Microsoft.IdentityModel.S2S.Tokens.JsonWebSecurityTokenHandler.ReadTokenCore(String token, Boolean isActorToken)     at Microsoft.SharePoint.IdentityModel.SPApplicationAuthenticationModule.TryExtractAndValidateToken(HttpContext httpContext, SPIncomingTokenContext& tokenContext)
SharePoint Foundation    Application Authentication    High    SPApplicationAuthenticationModule: Error authenticating request, Error details: Header: 3000006;reason="Token contains invalid signature.";category="invalid_client", Body: {"error_description":"Invalid JWT token. Could not resolve issuer token."}
SharePoint Foundation    General    Medium    Application error when access _vti_bin/client.svc, Error=Invalid JWT token. Could not resolve issuer token.   at Microsoft.IdentityModel.S2S.Tokens.JsonWebSecurityTokenHandler.ReadTokenCore(String token, Boolean isActorToken)     at Microsoft.IdentityModel.S2S.Tokens.JsonWebSecurityTokenHandler.ReadActor(IDictionary`2 payload)     at Microsoft.IdentityModel.S2S.Tokens.JsonWebSecurityTokenHandler.ReadTokenCore(String token, Boolean isActorToken)     at Microsoft.SharePoint.IdentityModel.SPApplicationAuthenticationModule.TryExtractAndValidateToken(HttpContext httpContext, SPIncomingTokenContext& tokenContext)

Solução:

Execute o timer job "Refresh Trusted Security Token Services Metadata feed" do SharePoint utilizando Powershell (Start-SPTimerJob RefreshMetadataFeed) ou na interface.

[]

Um comentário: