I have a web page made in GWT. There I use all the login facebook stuff with a manipulated gwtfb library, all works fine. After migrating to oauth 2.0 now the cookie sent to the server has changed to a encrypted one.
I want to get a java example code that implements in the server the same than the old one:
- I need to validate the call like I did before using the cookie md5 trick to know if the call has been made by my client page.
- Get data from that cookie: I need the facebook user.
If possible not calling FB, just using the cookie data.
Thanks in advance.
Well, although I have a few good answers I answer myself with what I have written in my blog:
http://pablocastilla.wordpress.com/2011/09/25/how-to-implement-oauth-f/
Now the cookie has changed a lot: it is encrypted, doesn’t have the accesstoken and its content format has changed a lot. Here you have a few links talking about it:
http://developers.facebook.com/docs/authentication/signed_request/
http://developers.facebook.com/docs/authentication/
http://blog.sociablelabs.com/2011/09/19/server-side-changes-facebook-oauth-2-0-upgrade/
So to validate the cookie, get the user from it and get the access token you could use this code: