Uploaded image for project: 'Apache Oltu'
  1. Apache Oltu
  2. OLTU-150

TokenValidator does not recognize access_token parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Do
    • oauth2-1.0.0
    • None
    • oauth2-client
    • 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='

      {"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)

      Attachments

        Activity

          People

            Unassigned Unassigned
            allancth Allan Cheong Tyng Huei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: