Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Won't Do
-
oauth2-1.0.0
-
None
-
None
-
WIndows 7 x64, JDK1.8
Description
Code:
final String accessToken = "this-is-an-access-token";
OAuthClientRequest request = new OAuthBearerClientRequest("https://graph.facebook.com/me").setAccessToken(accessToken).buildQueryMessage();
System.out.println(request.getLocationUri());
final URLConnectionClient urlConnectionClient = new URLConnectionClient();
final OAuthJSONAccessTokenResponse jsonResponse = urlConnectionClient.execute(request, null, HttpMethod.GET, OAuthJSONAccessTokenResponse.class);
System.out.println(jsonResponse);
Exception:
https://graph.facebook.com/me?access_token=this-is-an-access-token
Exception in thread "main" OAuthProblemException{error='
', description='null', uri='null', state='null', scope='null', redirectUri='null', responseStatus=0, parameters={}}
at org.apache.oltu.oauth2.common.exception.OAuthProblemException.error(OAuthProblemException.java:59)
at org.apache.oltu.oauth2.client.validator.OAuthClientValidator.validateErrorResponse(OAuthClientValidator.java:63)
at org.apache.oltu.oauth2.client.validator.OAuthClientValidator.validate(OAuthClientValidator.java:48)
at org.apache.oltu.oauth2.client.response.OAuthClientResponse.validate(OAuthClientResponse.java:64)
at org.apache.oltu.oauth2.client.response.OAuthClientResponse.init(OAuthClientResponse.java:59)
at org.apache.oltu.oauth2.client.response.OAuthAccessTokenResponse.init(OAuthAccessTokenResponse.java:52)
at org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory.createCustomResponse(OAuthClientResponseFactory.java:60)
at org.apache.oltu.oauth2.client.URLConnectionClient.execute(URLConnectionClient.java:111)
at my.package.Main.main(Main.java:208)