C'est le problème lorsque j'essaie de recevoir un jeton d'accès de github.Apache Oltu unsupported_response_type
OAuthProblemException{error='unsupported_response_type', description='Invalid response! Response body is not application/json encoded', uri='null', state='null', scope='null', redirectUri='null', responseStatus=0, parameters={}}
Je veux garder aussi général que possible, donc je ne veux pas utiliser la classe GithubTokenResponse
. Quelles options me reste-t-il pour éviter l'exception?
OAuthClient oAuthClient = new OAuthClient(new URLConnectionClient());
OAuthClientRequest request = OAuthClientRequest
.tokenLocation("https://github.com/login/oauth/access_token")
.setCode(code)
.setGrantType(GrantType.AUTHORIZATION_CODE)
.setClientId(id)
.setClientSecret(secret)
.buildQueryMessage();
OAuthAccessTokenResponse tk = oAuthClient.accessToken(request); //this causes the problem
solution "Ugly":
GitHubTokenResponse tk = oAuthClient.accessToken(request, GitHubTokenResponse.class);