Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to add user authentication and ask for more FB user permissions in a facebook page tab app?
    text
    copied!<p>I am designing some FB Page Tab apps which will needs the FB user information. I want to ask for user permission as soon as the user hits the Tab of the application installed on the page. Then, if I get the user and the page's information I can carry on with my app.</p> <p>The Problem is that I want the user to be directed to the oauth dialog box as soon as he hits the tab and not with a click of a button. And that is why I am not using the popup scheme for getting user's permission. A popup without click won't be allowed on most browsers. What I have done so far is used the "LOGIN with CANVAS APPS" directions</p> <p><a href="https://developers.facebook.com/docs/howtos/login/login-for-canvas/" rel="nofollow noreferrer">https://developers.facebook.com/docs/howtos/login/login-for-canvas/</a></p> <p>This allows me to direct the user to oauth dialog as soon as he hits the tab and also there is callback which gets me the user permission and run the app as a Canvas App, which I don't really want. The problem with this is I get the page ID when the user hits the tab and but when the user comes back to the callback URL, the request object contains user info and not Page Id. I have tried storing the page id in session but somehow it gets destroyed when app returns on the callback url. I might store it in the DB and access it again but I am not sure I should be doing that.</p> <p>I have researched and one way was calling back the user to you page tab app by storing the page link and id and then regenerating the link and use that as the callback. Not too keen on that as well. All this problem because you can't run oauth dialog in an iframe. </p> <p>I am using Rails and its omniauth-facebook gem for this.</p> <p>Here, are some links where somewhat same problem has been discussed and some suggestions made.</p> <p><a href="https://stackoverflow.com/questions/8158657/redirect-back-to-page-tab-after-user-authenticates">Redirect back to page tab after user authenticates?</a></p> <p><a href="https://stackoverflow.com/questions/11972450/automatically-invoking-fb-login-on-facebook-page-tab-app-for-non-logged-in-user">Automatically invoking FB.login on Facebook page tab app for non-logged in user</a></p> <p>I have started this new thread as the ones above are quite old. I know my dilemma might be trivial and I might be missing some small point. But any help would be really appreciated.</p> <p>Please do tell if there is any code you need to make my question more clear.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload