1 Reply Latest reply: Jun 3, 2012 1:12 PM by gimbal2 RSS

    server side request(GET?) to exchange token in Oauth2 with facebook

    941308
      First sorry for my English

      I'm a beginner in Java, and for my studies i need to implement Oauth2 with facebook to get authencation. I tried to write a servelet with the method Service, and i got the code thah i have to use in a second request.

      Now i need to send a request at this URL :

      1) https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&redirect_uri=YOUR_REDIRECT_URI&client_secret=YOUR_APP_SECRET&code=CODE_GENERATED_BY_FACEBOOK

      and wait for a responce with an URL that have the access_token to use with facebook

      2) http://....access_token=USER_ACESS_TOKEN&expires=NUMBER_OF_SECONDS_UNTIL_TOKEN_EXPIRES

      AS i told you i'm a beginner as my question is:
      Is Possible in a single Servlet after i receive the "code" to send a second request to the URL in 1 and get the responce with URL in 2 to retrieve the access_token??
      if yes....how??

      Tanks
      GIO