Results 1 to 10 of 11

Thread: Facebook/twitter "instant" login

Hybrid View

  1. #1
    Join Date
    May 2011
    Posts
    4

    Default Facebook/twitter "instant" login

    Hi,

    We have a system working with Spring Social and have implemented the "login with facebook" and "login with twitter" buttons. We have received a request to add the facility to perform an "instant" login. The request relates to a hypothetical user who has already linked their account on our system to say Facebook and is currently logged into Facebook but not to our system. I want to know if there is some way to log the user straight into our system as soon as they visit the front page without first requiring them to click on a "login with Facebook" button.

    My questions therefore are:

    (1) Is it possible to perform such an "instant" login with Spring Social?
    (2) If not, is it even theoretically possible with another framework?

    Thanks in advance.

    Cheers, Adam.

  2. #2
    Join Date
    Mar 2011
    Posts
    6

    Default

    Did you manage to get the instant login?

  3. #3
    Join Date
    May 2011
    Posts
    4

    Default

    No, I never did. I suspect it's not possible but I never found out for sure.

  4. #4
    Join Date
    Aug 2004
    Posts
    1,073

    Default

    I see no reason why it couldn't be done (disclaimer: I've not tried it). The way the "Sign In With XXX" functionality is kicked off is with a form submission, so at very least you should be able to...

    - Use each platform's respective JS API to determine if the user already has a Twitter/Facebook session in play.
    - If there is a session, then have some JavaScript that submits that form automatically
    - There'll be a browser redirect, but in the end the user can be returned to the front page.

    There are likely other ways to do this (maybe even ways that avoid the browser redirects), but it will take some experimentation to find them. I encourage you to try out the approach I spelled out above and let us know if it works. Or if you find a better way, we'd also be interested in hearing that.
    Craig Walls
    Spring Social Project Lead

  5. #5
    Join Date
    Sep 2007
    Posts
    138

    Default

    I'd do like Craig said, and do this from your initial signin page, this way if they haven't had a previous connection made with facebook they could still login with their normal login credentials. This is where the Social tag that Craig helped me with comes in handy. Something like this you could do on your signin page, which will attempt to automatically sign them if they have a facebook connection...

    Code:
    <%@ taglib prefix="social" uri="http://localhost/social" %> 
    
    <script type="text/javascript">
    	$(document).ready(function() { //using jquery 
    		<social:connected provider="facebook">	
    			$("#fb_signin_form").submit();
    		</social:connected provider="facebook">	
    	});
    </script>
    If you want the tag code just let me know (or it's back a few pages in this forum as well.)

  6. #6
    Join Date
    Aug 2004
    Posts
    1,073

    Default

    I like that tag, BTW. If you submit a pull request, I might review it in more depth and merge it into Spring Social. I could do it by copying what's in the previous forum post, but as a pull request you'll get credit for the work.
    Craig Walls
    Spring Social Project Lead

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
  •