I\'m trying to set up my (iframe) Facebook application to use OAuth for authentication. I used the python-sdk from Facebook, but I\'m not really satisfied by the result, yet
The first page is an error. You absolutely can avoid that page. The problem is likely related to how you are doing the redirects to the login page in the first place. Without a code sample, that is really the best answer I can give.
yes, top.location.href should do the trick. If you get the problem that the app breaks out the iframe, make sure you use the canvas PAGE url in your redirect, in stead of canvas url (in your app settings)
This happens, apparently due to a bug in the Facebook side... I found this solution.
<script type="text/javascript">
top.location.href = '<?php echo $loginUrl ?>';
</script>
$loginUrl = your URL
Could work this way:
<script type="text/javascript">
top.location.href = 'http://www.yourappUrl.com';
</script>
always use this code in script tags...
The issue is caused to the code Facebook uses to bust out of iframes. A bug has been filed on Facebook's bugzilla: http://bugs.developers.facebook.net/show_bug.cgi?id=11326
The only known solution to this problem is to do the first redirect to https://graph.facebook.com/oauth/authorize? from the client side (i.e. Via JavaScript), using
<script type='text/javascript'>
top.location.href="https://graph.facebook.com/oauth/authorize?.......
</script>
This can be triggered when the user clicks on some element (e.g. a login button) or whenever a specific page is visited (just include it in the HTML head).