I am trying to connect to Facebook applications, but I am having problems getting authorization working in the redirect scheme inside the canvas.
Using the javascript api, I got it pretty easily in a popup scheme:
$("#loginButton").click(function(e) { FB.login(function(response) { if (response.perms) { perms(); } }, {perms : 'publish_stream'});
But the popup should be an extra extra click, because every other application that I see is asking for authorization, even showing you the landing page. Like this:
http://i.imgur.com/yBGzL.png
I suppose they just use a redirect scheme. So I tried all day to find different ways:
header("Location: https://graph.facebook.com/oauth/authorize?client_id=" . $gAppId . "&redirect_uri=" . urlencode($gUrl) . "&perms=publish_stream"); header("Location: http://www.facebook.com/login.php?v=1.0&api_key=" . $gApiKey . "&next=" . urlencode($gUrl) . "&canvas="); header("Location: http://www.facebook.com/connect/uiserver.php?app_id=" . $gAppId . "&next=" . urlencode($gUrl) . "&return_session=0&fbconnect=0&canvas=1&legacy_return=1&method=permissions.request");
But all of them, instead of showing the authorization request material, show a link like this:
http://i.imgur.com/bLwPQ.png
Fun, if I open the iframe address in a new tab, I get the authorization request as I wanted. But I want it to be displayed immediately, without an additional click, as in any other application.
Here is an example of an application that performs authorization and requests permission at a time in the form of a redirect, even showing the landing page:
www.facebook.com/send.fortune.cookies
How do they do it?
redirect authorization facebook
Brandon
source share