Announcement Announcement Module
No announcement yet.
Is there any easy way to implement Facebook connect integrated with Spring Security Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there any easy way to implement Facebook connect integrated with Spring Security

    I am trying to implement facebook login (connect). My application uses Spring Security for normal authentication.
    I tried using spring-social but it seems it works when you have Spring MVC. I am not using Spring MVC.

    Does anyone know any easy/better way of doing this and integrating it with Spring Secuirty?


  • #2
    I'm not 100% sure what your use case is. You have authentication already and you just want to access user's data on the Facebook graph API?

    That's what the tonr2 sample does. It also relies on Spring MVC out of the box, but only for the session and request scopes - you can add those to an existing app, or you can use the Java APIs in OAuth2RestTemplate directly and manage the state yourself. AFAIK Spring Social doesn't have a mandatory dependency on Spring MVC either, but I can believe it would make it easier to use.


    • #3
      Thanks a lot Dave.
      Its like I need to authenticate, fetch some attributes (Graph API) and then map the external user to my internal user.

      I noticed, for google using openid, it looks pretty straight forward. But for Facebook, seems I need to write some filter.
      I tried to use
      but it seems its not compatible with latest spring security and spring-social releases.

      I am also getting tempted to use Facebook javascript api and then pass the access-token cookie to server. But then I need to have some code which will read that cookie and form the user-session using spring-security.