0

I have written a JAVA servlet that calls a Facebook URL and gets back a JSON String. Now, I authenticate the user using OAuth 2.0 before making calls to this URL.

All this is happening at the background using ExecutorService in JAVA. Once I call ExecutorService for all this processing, I immediately redirect the page to another URL by using the following command:

request.getRequestDispatcher("Thanks.jsp").forward(request, response);

Now, how do I log-off from Facebook for the user in the background processing that is happening? The browser page has already moved to "Thanks.jsp" by delegating the processing to ExecutorService in the background.

Soufiane Hassou
  • 15,973
  • 2
  • 36
  • 71
London guy
  • 24,942
  • 40
  • 110
  • 169

1 Answers1

0

you can invalidate access_token (aka logout) by making HTTP GET call to this endpoint

https://api.facebook.com/restserver.php?method=auth.expireSession&format=json&access_token=

beerstorm
  • 7,882
  • 3
  • 28
  • 41
  • Can you please tell me how do I make a GET call to the above URL? I know servlets and have written doGet methods. I understand that if I type a URL in the browser, the corresponding doGet method gets executed. But how do I make a HTTP GET call given a particular URL? – London guy Apr 25 '12 at 09:21
  • java has standard http libraries, that's plain http call to external endpoint. remember that you need to append the access_token value to the last param – beerstorm Apr 25 '12 at 09:41
  • example; http://stackoverflow.com/questions/1359689/how-to-send-http-request-in-java – beerstorm Apr 25 '12 at 09:42