Announcement Announcement Module
No announcement yet.
One connection to multiple users Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • One connection to multiple users


    Currently, Spring Social enables to users that they can connect multiple accounts on my system to one Facebook/Twitter account. After that, they cannot login with Facebook/TW, as far as I know this is normal in such case, but I would rather prevent this situation so that they cannot make a second connection...

    Does anyone has some experience or tips how to solve this?

    Thank you!

  • #2
    Although the framework allows you to create multiple accounts, that doesn't mean you have to let them. Spring Social Showcase, for example, doesn't offer the "connect" button if an existing connection already exists.


    • #3
      I think I'm misunderstood here
      user1 in my webapp connects with facebook account 1
      user2 in my webapp connects with facebook account 1. After that, login with facebook is not available, because how to choose what account to login?

      I would like to intercept and disable connecting with facebook for user2 because users facebook account 1 is already used (user1)...


      • #4

        I encountered this problem also - it would be great if there was a way to solve this by doing as you suggest and intercepting the connection with facebook for user2 *before* they complete the connection - if anyone has any suggestions on this that would be really helpful.

        I ended up using a workaround solution where I use a ConnectInterceptor registered for each Provider which ensures that the connection is not already associated with a different user account, and if so it removes this second duplicate connection and informs the user. This "EnsureUniqueConnectionInterceptor" then throws an exception which can be handled by the application - forwarding the user to a "sorry this provider account is already associated with a different user account" error page.

        I can't remember off the top of my head whether the save of a connection to the database is executable in the same transaction as the connect interceptors - if so then this solution could perform the check and remove the duplicate connection within the same transaction safely. If not within the same transaction then this solution is bit cludgy - I'd love to find a better way to do this. We really need a prePersist method on ConnectInterceptor for an elegant solution.

        FYI the code for this interceptor I used is here:


        • #5

          Thank you, michaellavelle

          This solved my problem perfectly! Although, I had to create two interceptors, one for Facebook, other for Twitter.