Results 1 to 5 of 5

Thread: One connection to multiple users

Hybrid View

  1. #1
    Join Date
    Aug 2012
    Posts
    3

    Default One connection to multiple users

    Hello!

    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. #2
    Join Date
    Aug 2004
    Posts
    1,070

    Default

    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.
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Aug 2012
    Posts
    3

    Default

    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. #4
    Join Date
    Oct 2011
    Location
    London, UK
    Posts
    27

    Default

    Hi

    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:

    https://github.com/socialsignin/spri...terceptor.java

  5. #5
    Join Date
    Aug 2012
    Posts
    3

    Default

    Hi!

    Thank you, michaellavelle

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •