<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Authorizing Iframe Facebook Applications For Graph API</title>
	<atom:link href="http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=authorizing-iframe-facebook-applications-for-graph-api</link>
	<description>My life, my work</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:37:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jozef Chúťka</title>
		<link>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/comment-page-3/#comment-4657</link>
		<dc:creator>Jozef Chúťka</dc:creator>
		<pubDate>Mon, 13 Jun 2011 07:56:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.yoz.sk/?p=1732#comment-4657</guid>
		<description>hi Etienne,
glad you made it work. its really interesting that it does not work correctly with ff. it may be due to flash app is not completely prepared. not sure what may case the issue:
- missing flashvars?
- shared object not ready?
- stage and urlloader not ready?</description>
		<content:encoded><![CDATA[<p>hi Etienne,<br />
glad you made it work. its really interesting that it does not work correctly with ff. it may be due to flash app is not completely prepared. not sure what may case the issue:<br />
- missing flashvars?<br />
- shared object not ready?<br />
- stage and urlloader not ready?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Etienne</title>
		<link>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/comment-page-3/#comment-4656</link>
		<dc:creator>Etienne</dc:creator>
		<pubDate>Sat, 11 Jun 2011 08:08:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.yoz.sk/?p=1732#comment-4656</guid>
		<description>Hi Jozef,

I discover something strange...
Concerning as3 graph api iframe embeding exemples from facebook-actionscript-api google code (wich are working fine) :

On firefox 3.6.12 and previous, the auto init (auto connect) is not working. The app will work outside of FB but not in the canvas.
But if you set a setTimeout (even with no delay) before the embed swf function..... it works !!

I know that doesn&#039;t concern your own embeding solution but the facebook-actionscript-api one.

However, perhaps yours have the same kind of issue on on 3.6.12 and previous.</description>
		<content:encoded><![CDATA[<p>Hi Jozef,</p>
<p>I discover something strange&#8230;<br />
Concerning as3 graph api iframe embeding exemples from facebook-actionscript-api google code (wich are working fine) :</p>
<p>On firefox 3.6.12 and previous, the auto init (auto connect) is not working. The app will work outside of FB but not in the canvas.<br />
But if you set a setTimeout (even with no delay) before the embed swf function&#8230;.. it works !!</p>
<p>I know that doesn&#8217;t concern your own embeding solution but the facebook-actionscript-api one.</p>
<p>However, perhaps yours have the same kind of issue on on 3.6.12 and previous.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Langley</title>
		<link>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/comment-page-3/#comment-4634</link>
		<dc:creator>Bill Langley</dc:creator>
		<pubDate>Thu, 05 May 2011 18:04:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.yoz.sk/?p=1732#comment-4634</guid>
		<description>Yikes! Sorry for all the frustration. The root problem was that I hadn&#039;t included the www in the site&#039;s app url. The client redirects when it is missing. The redirect then caused the POST data to disappear. 

Thanks for all your help!</description>
		<content:encoded><![CDATA[<p>Yikes! Sorry for all the frustration. The root problem was that I hadn&#8217;t included the www in the site&#8217;s app url. The client redirects when it is missing. The redirect then caused the POST data to disappear. </p>
<p>Thanks for all your help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Langley</title>
		<link>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/comment-page-3/#comment-4633</link>
		<dc:creator>Bill Langley</dc:creator>
		<pubDate>Wed, 04 May 2011 23:07:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.yoz.sk/?p=1732#comment-4633</guid>
		<description>Sorry, guess the PHP got consumed:

$app_uri = &quot;http://apps.facebook.com/sambazon_warrior_up/&quot;;
				$auth_uri = &quot;https://www.facebook.com/dialog/oauth&quot;;
				$client_id = &quot;[my id]&quot;;
				$scope = &quot;publish_stream,user_photos,user_photo_video_tags&quot;;
				
        		$signed_request = $_POST[&quot;signed_request&quot;];
        		list($encoded_sig, $payload) = explode(&#039;.&#039;, $signed_request, 2);
        		$data = base64_decode(strtr($payload, &#039;-_&#039;, &#039;+/&#039;));
				
				
				if(empty($signed_request)){
					echo (	&quot;window.top.location = &#039;&quot; . $auth_uri .
							&quot;?client_id=&quot; . $client_id .
							&quot;&amp;redirect_uri=&quot; . urlencode($app_uri) .
							&quot;&amp;scope=&quot; . $scope . 
							&quot;&amp;response_type=token&#039;;&quot;);
				}else{
					echo &quot;var signed_request=&quot; . $data . &quot;;&quot;;
					echo &quot;generateFlash();&quot;;
				}</description>
		<content:encoded><![CDATA[<p>Sorry, guess the PHP got consumed:</p>
<p>$app_uri = &#8220;http://apps.facebook.com/sambazon_warrior_up/&#8221;;<br />
				$auth_uri = &#8220;https://www.facebook.com/dialog/oauth&#8221;;<br />
				$client_id = &#8220;[my id]&#8220;;<br />
				$scope = &#8220;publish_stream,user_photos,user_photo_video_tags&#8221;;</p>
<p>        		$signed_request = $_POST["signed_request"];<br />
        		list($encoded_sig, $payload) = explode(&#8216;.&#8217;, $signed_request, 2);<br />
        		$data = base64_decode(strtr($payload, &#8216;-_&#8217;, &#8216;+/&#8217;));</p>
<p>				if(empty($signed_request)){<br />
					echo (	&#8220;window.top.location = &#8216;&#8221; . $auth_uri .<br />
							&#8220;?client_id=&#8221; . $client_id .<br />
							&#8220;&amp;redirect_uri=&#8221; . urlencode($app_uri) .<br />
							&#8220;&amp;scope=&#8221; . $scope .<br />
							&#8220;&amp;response_type=token&#8217;;&#8221;);<br />
				}else{<br />
					echo &#8220;var signed_request=&#8221; . $data . &#8220;;&#8221;;<br />
					echo &#8220;generateFlash();&#8221;;<br />
				}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Langley</title>
		<link>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/comment-page-3/#comment-4632</link>
		<dc:creator>Bill Langley</dc:creator>
		<pubDate>Wed, 04 May 2011 23:06:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.yoz.sk/?p=1732#comment-4632</guid>
		<description>Now I&#039;m even more perplexed. I can now see the signed_request variable and am able to parse the oauth_token out of it, but I&#039;m still seeing the page constantly refresh itself... even if I remove the generateFlash() function. On Chrome it just repeats. On Firefox it throws up &quot;Object Moved&quot;. Here is my PHP:

                  

BTW: I am not able to create the signed_request var like your example. The initial var signed_request=; throws up an error in my JS console.</description>
		<content:encoded><![CDATA[<p>Now I&#8217;m even more perplexed. I can now see the signed_request variable and am able to parse the oauth_token out of it, but I&#8217;m still seeing the page constantly refresh itself&#8230; even if I remove the generateFlash() function. On Chrome it just repeats. On Firefox it throws up &#8220;Object Moved&#8221;. Here is my PHP:</p>
<p>BTW: I am not able to create the signed_request var like your example. The initial var signed_request=; throws up an error in my JS console.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jozef Chúťka</title>
		<link>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/comment-page-3/#comment-4630</link>
		<dc:creator>Jozef Chúťka</dc:creator>
		<pubDate>Wed, 04 May 2011 18:35:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.yoz.sk/?p=1732#comment-4630</guid>
		<description>request to http://apps.facebook.com/sambazon_warrior_up :

POST /fbapp/ HTTP/1.1
Host: sambazon.com
Referer: http://apps.facebook.com/sambazon_warrior_up/

signed_request=N7GgX95r...

asi you can see, there surely is post parameter available!</description>
		<content:encoded><![CDATA[<p>request to <a href="http://apps.facebook.com/sambazon_warrior_up" rel="nofollow">http://apps.facebook.com/sambazon_warrior_up</a> :</p>
<p>POST /fbapp/ HTTP/1.1<br />
Host: sambazon.com<br />
Referer: <a href="http://apps.facebook.com/sambazon_warrior_up/" rel="nofollow">http://apps.facebook.com/sambazon_warrior_up/</a></p>
<p>signed_request=N7GgX95r&#8230;</p>
<p>asi you can see, there surely is post parameter available!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Langley</title>
		<link>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/comment-page-3/#comment-4629</link>
		<dc:creator>Bill Langley</dc:creator>
		<pubDate>Wed, 04 May 2011 16:42:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.yoz.sk/?p=1732#comment-4629</guid>
		<description>Hi Jozef,

My client&#039;s server accepts _POST vars because when I use FB&#039;s technique:

&lt;?php 

    $app_id = YOUR_APP_ID;
    $app_secret = &quot;YOUR_APP_SECRET&quot;;
    $my_url = &quot;YOUR_URL&quot;;

    $code = $_REQUEST[&quot;code&quot;];

    if(empty($code)) {
        $dialog_url = &quot;http://www.facebook.com/dialog/oauth?client_id=&quot; 
            . $app_id . &quot;&amp;redirect_uri=&quot; . urlencode($my_url);

        echo(&quot; top.location.href=&#039;&quot; . $dialog_url . &quot;&#039;&quot;);
    }

    $token_url = &quot;https://graph.facebook.com/oauth/access_token?client_id=&quot;
        . $app_id . &quot;&amp;redirect_uri=&quot; . urlencode($my_url) . &quot;&amp;client_secret=&quot;
        . $app_secret . &quot;&amp;code=&quot; . $code;

    $access_token = file_get_contents($token_url);

    $graph_url = &quot;https://graph.facebook.com/me?&quot; . $access_token;

    $user = json_decode(file_get_contents($graph_url));

    echo(&quot;Hello &quot; . $user-&gt;name);

?&gt;

I am able to get $code, but unable to get file_get_contents($token_url); to work because (I&#039;m assuming) the $token_url is secure.

However, when I use your technique I am never able to get $signed_request either with $_REQUEST[&quot;signed_request&quot;] or $_POST[&quot;signed_request&quot;]. So, I&#039;m stuck with a looping app.

Also, I don&#039;t understand how your post &quot;neverending facebook changes...&quot; applies to this. They seem like 2 different techniques.

I greatly appreciate any light you can shed on this.

Thx,
WL

http://apps.facebook.com/sambazon_warrior_up</description>
		<content:encoded><![CDATA[<p>Hi Jozef,</p>
<p>My client&#8217;s server accepts _POST vars because when I use FB&#8217;s technique:</p>
<p>&lt;?php </p>
<p>    $app_id = YOUR_APP_ID;<br />
    $app_secret = &quot;YOUR_APP_SECRET&quot;;<br />
    $my_url = &quot;YOUR_URL&quot;;</p>
<p>    $code = $_REQUEST[&quot;code&quot;];</p>
<p>    if(empty($code)) {<br />
        $dialog_url = &quot;<a href="http://www.facebook.com/dialog/oauth?client_id=&#038;quot" rel="nofollow">http://www.facebook.com/dialog/oauth?client_id=&#038;quot</a>;<br />
            . $app_id . &quot;&amp;redirect_uri=&quot; . urlencode($my_url);</p>
<p>        echo(&quot; top.location.href=&#8217;&#8221; . $dialog_url . &#8220;&#8216;&#8221;);<br />
    }</p>
<p>    $token_url = &#8220;https://graph.facebook.com/oauth/access_token?client_id=&#8221;<br />
        . $app_id . &#8220;&amp;redirect_uri=&#8221; . urlencode($my_url) . &#8220;&amp;client_secret=&#8221;<br />
        . $app_secret . &#8220;&amp;code=&#8221; . $code;</p>
<p>    $access_token = file_get_contents($token_url);</p>
<p>    $graph_url = &#8220;https://graph.facebook.com/me?&#8221; . $access_token;</p>
<p>    $user = json_decode(file_get_contents($graph_url));</p>
<p>    echo(&#8220;Hello &#8221; . $user-&gt;name);</p>
<p>?&gt;</p>
<p>I am able to get $code, but unable to get file_get_contents($token_url); to work because (I&#8217;m assuming) the $token_url is secure.</p>
<p>However, when I use your technique I am never able to get $signed_request either with $_REQUEST["signed_request"] or $_POST["signed_request"]. So, I&#8217;m stuck with a looping app.</p>
<p>Also, I don&#8217;t understand how your post &#8220;neverending facebook changes&#8230;&#8221; applies to this. They seem like 2 different techniques.</p>
<p>I greatly appreciate any light you can shed on this.</p>
<p>Thx,<br />
WL</p>
<p><a href="http://apps.facebook.com/sambazon_warrior_up" rel="nofollow">http://apps.facebook.com/sambazon_warrior_up</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jozef Chúťka</title>
		<link>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/comment-page-3/#comment-4627</link>
		<dc:creator>Jozef Chúťka</dc:creator>
		<pubDate>Wed, 04 May 2011 07:51:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.yoz.sk/?p=1732#comment-4627</guid>
		<description>hi Bill. 
- you do not extract nothing from top.location, you pass there url to get authorized 
- if you have correct facebook setting (see the ones from me) you should get some authorization info in POST variables. make sure yor server support _POST variable</description>
		<content:encoded><![CDATA[<p>hi Bill.<br />
- you do not extract nothing from top.location, you pass there url to get authorized<br />
- if you have correct facebook setting (see the ones from me) you should get some authorization info in POST variables. make sure yor server support _POST variable</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Langley</title>
		<link>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/comment-page-3/#comment-4625</link>
		<dc:creator>Bill Langley</dc:creator>
		<pubDate>Tue, 03 May 2011 16:27:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.yoz.sk/?p=1732#comment-4625</guid>
		<description>I can&#039;t get this new auth to work. I don&#039;t understand how I&#039;m supposed to extract the top.location access_token hash when the app is inside an iframe. Also, I tried the PHP $signed_request method and it always comes up empty. I have &quot;Oauth 2 for Canvas&quot; and &quot;POST for Canvas&quot; enabled. No matter what I try, I can&#039;t get to the access_token. What am I missing here?</description>
		<content:encoded><![CDATA[<p>I can&#8217;t get this new auth to work. I don&#8217;t understand how I&#8217;m supposed to extract the top.location access_token hash when the app is inside an iframe. Also, I tried the PHP $signed_request method and it always comes up empty. I have &#8220;Oauth 2 for Canvas&#8221; and &#8220;POST for Canvas&#8221; enabled. No matter what I try, I can&#8217;t get to the access_token. What am I missing here?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William Everich</title>
		<link>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/comment-page-3/#comment-4616</link>
		<dc:creator>William Everich</dc:creator>
		<pubDate>Thu, 21 Apr 2011 21:07:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.yoz.sk/?p=1732#comment-4616</guid>
		<description>Right now this is my favorite page on the internet.  Thank you all!!</description>
		<content:encoded><![CDATA[<p>Right now this is my favorite page on the internet.  Thank you all!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

