Topic-icon First-Time Auto Login

Active Subscriptions:

None
11 years 3 months ago #29703 by keenmouse
My Facebook app is set up as a "Website with Facebook Login". This part of the App Center Tutorial says:

The app detail page in the App Center will take care of authorizing users before they arrive on your website, but it's important to make sure that these users have a personalized experience when they land on your site after clicking through from App Center. Users should not have to click a second "Login to Facebook" button on your website, rather they should see some evidence of personalization in order to optimize the user experience.

This seems to imply that a user should be automatically logged in even if he hasn't visited and registered on my site before. Is this possible? I want to be sure I've got this right before I submit my app for approval, because they say that this is one of the most common reasons for an app to be rejected.

I suppose this should only happen if the first-time user is coming directly from Facebook, because it doesn't seem right to automatically log users in using their Facebook accounts without any choice in the matter if they're coming from a link somewhere else, right?
The topic has been locked.
Support Specialist
11 years 3 months ago #29710 by alzander
Replied by alzander on topic First-Time Auto Login
To comply with that requirement for the App Center, you'd need to configure JFBConnect with the below settings:
* Registration Flow: Automatic
* Auto login Facebook Users: Yes

When a user visits your site from the App Center, Facebook will make them approve your application first. Then, when they come to your site, they will be automatically logged in and account will be created for them.

If a user comes to your site from Google (or somewhere else), they won't have approved your Facebook App first.. so in that case, they'd need to click the "Login with Facebook" button.

Hope that helps explain, but if you have any questions or issues, just let me know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 3 months ago #29747 by keenmouse
Replied by keenmouse on topic First-Time Auto Login
Ah, I see. I did try those settings, but I see that my issue is with my Facebook test user.

When I create a test user, Facebook asks me to choose whether to pre-authorize my app for the user. If I do, then the first-time auto-login to my site doesn't happen because it's triggered by the Facebook authorization, which doesn't pop up because the app is already authorized. If I don't pre-authorize my app, I can't test adding it manually, because of the catch-22 that my app isn't approved yet so it doesn't show up in a search. So it's untestable, but I believe you that it will work. ;)

By the way, I was wondering if you could give me a couple of PHP expressions that I can use to display certain things conditionally. I need one that evaluates true if the user logged on with Facebook and (if possible) one that evaluates true if it's the user's first Facebook login, i.e. the user was just created in the same session.

Thanks!
The topic has been locked.