Results 1 to 3 of 3

Thread: Unable to access session varibale "social.addConnection.duplicate"

  1. #1
    Join Date
    Apr 2010
    Posts
    16

    Default Unable to access session varibale "social.addConnection.duplicate"

    Hi all,

    I've been trying to access the session variable "social.addConnection.duplicate" in my controllers but it seems it is not present in the session. I verified that in the ConnectController it gets set. What I am trying to achieve is to provide a message to the user if there is already a Social connection present for a particular Facebook account.

    Thanks in advance.

  2. #2
    Join Date
    Aug 2004
    Posts
    1,075

    Default

    You're right that ConnectController sets that in the session, but you may not have noticed that ConnectController also removes it from the session (in the processFlash() method). It sets it upon encountering the duplicate, then redirects to the connect status URL, and then it deletes it.

    It's only put into session scope because request scoped attributes won't survive redirects. Therefore, ConnectController manages its own flash-scope so that the attribute will be around after redirecting back to the connection status page. If this were using Spring 3.1, I could rely on Spring 3.1's support for flash-scope instead...but since I have to also support Spring 3.0, which doesn't have flash-scope, I had to handle it all within ConnectController.

    But I see your point...you should be able to somehow display a message regarding the duplicate connection to the user upon arriving at the connection status page. By the time the view is displayed, the flash scope will have been cleared out. Hmmm....I have created https://jira.springsource.org/browse/SOCIAL-297 to address this.
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Apr 2010
    Posts
    16

    Default

    Hi,

    Thank you for the clarification. As a workaround when the user attempts to link a Facebook account we append a parameter 'q' to /connect/facebook?q=fb-link. An interceptor is written for the pattern /connect/facebook to check if q is present, if so a session variable is kept to indicate that the user started the process of authenticating with Facebook. Once the user comes to the origination page on the application we check if the q parameter is present and queries the UserConnection table to see if the account has been linked against the user. If not it is assumed that it failed due to a duplicate connection. It's not the best approach but it works.

    Looking forward to seeing https://jira.springsource.org/browse/SOCIAL-297 being resolved.

    Thanks.

Tags for this Thread

Posting Permissions

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