Announcement Announcement Module
No announcement yet.
Facebook JavaScript SDK and Spring Social Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Facebook JavaScript SDK and Spring Social

    Hi folks,

    I'm trying to make a canvas facebook application. For the login process i'm using the Facebook JavaScript SDK FB.login() function.
    After authentication the SDK sets a cookie "fbs_{appId}".

    I have found some documentation about annotation for controller @FacebookAccessToken but can't find the implementation in spring social RC1 libraries.

    I have to use JavaScript SDK for login because canvas redirect don't function properly if I use server-side authentication. When I use server-side login Facebook page redirects the top window, out of

    By other hand, JavaScript SDK opens a popup window remaining in and my app inside iframe.

    How can I use the cookie set by JS SDK FB.login() process, in server side using spring social?

    Thanks a lot in advance.

  • #2
    The @FacebookAccessToken annotation was replaced by the more general-purpose @FacebookCookieValue. You'd annotate the parameter with @FacebookCookieValue("access_token") to get the access token from the cookie.

    That said, be aware that FB is saying that the access token will be removed from the cookie soon. Originally it was to go away on July 1, but now I think the new date is July 20. It's a bit unclear what the new cookie will look like (FB has been quite vague as to the details), but I understand that it will contain a code that can be exchanged for an access token using the last part of the OAuth 2 flow. So, I'd caution against writing code that tries to pull the access token from the cookie.
    Last edited by habuma; Jul 14th, 2011, 03:13 PM.