I\'m getting this error while trying to get an access token for a user. This has to do with the authorization process of a facebook application. The code that produces that
I had the same problem implementing the client and the server, the problem is about one mistake in the Client Example in the Apache Amber (Oltu) project:
First you have the Auth code request (which work):
OAuthClientRequest request = OAuthClientRequest
.authorizationLocation(AUTHORIZE_URL)
.setClientId(CLIENT_ID)
.setRedirectURI(REDIR_URL)
.setResponseType(CODE_RESPONSE)
.**buildQueryMessage**();
And second the request about the Access Token (which don't work):
OAuthClientRequest request = OAuthClientRequest
.tokenLocation(ACCESS_TOKEN_URL)
.setGrantType(GrantType.AUTHORIZATION_CODE)
.setClientId(CLIENT_ID)
.setClientSecret(CLIENT_SECRET)
.setRedirectURI(REDIR_URL)
.setCode(code)
.**buildBodyMessage**();
The mistake is about the buildBodyMessage() in the second request. Change it by buildQueryMessage().
Enjoy :)
I think you can use the normal OAuthJSONAccessTokenResponse:
OAuthAccessTokenResponse oAuthResponse = oAuthClient.accessToken(request);
my problem is, Facebook responds with
OAuthProblemException{description='null', error='{"message":"Error validating verification code.","type":"OAuthException","code":100}', uri='null', state='null', scope='null'}
Any ideas?