Automatically invoking FB.login on Facebook page tab app for non-logged in user

I have a Facebook Page tab app. For a user who is not logged in, I want to:

  • Detect if user is not logged in
  • If not logged in, automatically direct user to login

My current approach is to use FB Javascript SDK (in preference to server-side authentication flow):

  • On page load, run FB.getLoginStatus to check user status
  • If user is not logged in, run FB.login to invoke OAuth dialog

Problem:

  • FB.login creates a pop-up dialog (prefer if within Page Tab iframe)
  • This pop-up dialog is blocked if FB.login is not invoked from a button (I would really like to avoid having the user click a button; so would really like to invoke it automatically, when I find a user that is not logged in)

Answers


I would really like to avoid having the user click a button

FB.login without user interaction -> blocked popup

prefer if within Page Tab iframe

The Auth dialog won’t work inside an iframe, it’s designed that way.

If the automatic call of the login dialog is your most important requirement – then use JavaScript to redirect to the Auth dialog URL, and redirect back to your page/app Facebook address afterwards. See section “Client-side authentication without the JS SDK” here: https://developers.facebook.com/docs/authentication/client-side/


Need Your Help

Making storage plugin on Apache Drill to HDFS

apache hadoop hdfs apache-drill hadoop-plugins

I'm trying to make storage plugin for Hadoop (hdfs) and Apache Drill.