Não é possível atualizar o token de acesso: a resposta é "unuthorized_client"
Estou recebendo um erro ao tentar atualizar o token de acesso:
400 pedido incorreto
{error: "unuthorized_client"}
Do URI do token do Google:
{
"error" : "invalid_request"
}
Eu li essa respostaAqui e a documentação oficial do Google (que descreve como umPOST
pedido deve olhar) e eu não vejo nenhuma diferença.
Eu capturei meuPOST
pedido (segredos removidos):
POST /SHOWMERAWPOST HTTP/1.1
User-Agent: Google-HTTP-Java-Client/1.10.3-beta (gzip)
Pragma: no-cache
Host: requestb.in
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 175
Connection: keep-alive
Cache-Control: no-cache
Accept-Encoding: gzip
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
grant_type=refresh_token&refresh_token=******&client_id=*******.apps.googleusercontent.com&client_secret=******
Código Java que envia o pedido:
RefreshTokenRequest req = new RefreshTokenRequest(new NetHttpTransport(), new JacksonFactory(), new GenericUrl(
getSecrets().getDetails().getTokenUri()), REFRESH_TOKEN);
req.set("client_id", getSecrets().getDetails().getClientId());
req.set("client_secret", getSecrets().getDetails().getClientSecret());
TokenResponse response = req.execute();
Há algo de errado?