Question

I have a website that's working with Facebook Connect (or Facebook for Websites as I think it's called now). When a user first comes to the site he's able ot browse around and do some simple things without any integration with Facebook. If he wants to perform some advanced operations, we need him logged into Facebook and to authorize our app to grab some very basic information about him. We're trying to be good corporate citizens by letting him get a taste of the site without forcing him to be logged in and authorize.

To do this, we have a Login button that he needs to push before performing advanced functions. When it's pushed we call https://www.facebook.com/dialog/oauth, etc. to get things set up.

This system works fine except for one thing. IF he is already logged into Facebook AND IF he has already authorized our app, he should just be frictionlessly logged in when he goes to the webapp. But, I can't see how to do this.

Sure, I can call https://www.facebook.com/dialog/oauth when he starts the webapp, and if the conditions are right, things work great. But if the conditions aren't right, then he's presented with a bunch of things to do that I don't want to task him with just yet.

Surely there's a way around this. How can I frictionlessly allow my users to authenticate through Facebook with the stipulation that if any of the conditions are wrong, just abort the whole process without showing the user anything?

Was it helpful?

Solution

Before you display a login button for the user, call FB.getLoginStatus() to see if they're already logged in or not.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top