Note that there are some explanatory texts on larger screens.

plurals
  1. POauthenticating facebook canvas application returns ?code=
    primarykey
    data
    text
    <p>i have a problem with my facebook canvas app that is currently on development i'm working on <a href="http://localhost:8080" rel="nofollow">http://localhost:8080</a></p> <p>my canvas url is <code>http://localhost:8080/fbcanvas/</code></p> <p>on facebook the url is set to <code>http://apps.facebook.com/app_name/</code></p> <p>the problem is i'm getting a code as an <code>$_GET['code']</code> variable after a user approves my app. in facebook documentation it doesnt say anything about getting a <code>$_GET['code']</code> it just says getting <code>signed_request</code></p> <p>this is the code i'm using from facebook examples.</p> <pre><code> require_once($_SERVER['DOCUMENT_ROOT'] . '/classes/Page.php'); require($_SERVER['DOCUMENT_ROOT'] . '/core/config.fb.php'); $canvas_page = 'http://apps.facebook.com/khawamusic/'; $auth_url = 'https://www.facebook.com/dialog/oauth?client_id=' . $app_id . '&amp;redirect_uri=' . urlencode($canvas_page); $signed_request = $_REQUEST['signed_request']; list($encoded_sig, $payload) = explode('.', $signed_request, 2); $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true); if(empty($data['user_id'])) { echo('&lt;script&gt; top.location.href="' . $auth_url .'";&lt;/script&gt;'); } else { $page = new Page; $styles = array('reset.css', 'fbcanvas.css'); $scripts = array( 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js', 'http://connect.facebook.net/en_US/all.js#xfbml=1', '/sources/js/fbcanvas.js' ); $page-&gt;set_title('Khawa'); $page-&gt;set_styles($styles); $page-&gt;set_scripts($scripts); $page-&gt;start_page(); require($_SERVER['DOCUMENT_ROOT'] . '/fbcanvas/fb.tpl'); $page-&gt;end_page(); } </code></pre> <p>so what happens is a user approves my app then he gets redirected to <code>http://apps.facebook.com/khawamusic/?code=blabla</code></p> <p>i'm cnfused because in the documentation it doesn't say i'm suppose to get a <code>$_GET['code']</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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