[ 
https://issues.apache.org/jira/browse/OLTU-150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Allan Cheong Tyng Huei updated OLTU-150:
----------------------------------------

    Priority: Minor  (was: Critical)

> TokenValidator does not recognize access_token parameter
> --------------------------------------------------------
>
>                 Key: OLTU-150
>                 URL: https://issues.apache.org/jira/browse/OLTU-150
>             Project: Apache Oltu
>          Issue Type: Bug
>          Components: oauth2-client
>    Affects Versions: oauth2-1.0.0
>         Environment: WIndows 7 x64, JDK1.8
>            Reporter: Allan Cheong Tyng Huei
>            Priority: Minor
>
> 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='{"code":190,"message":"Invalid OAuth access 
> token.","type":"OAuthException"}', 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)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to