Facebook Iframe应用程序 - 奇怪的重定向问题

问题描述:

当我在Facebook的iframe应用程序中进行服务器端重定向时,我得到这个奇怪的Facebook徽标与链接。当我点击它时,我将重定向到站点,我首先将重定向设置为。这里发生了什么?任何“点击保护”到位?Facebook Iframe应用程序 - 奇怪的重定向问题

谢谢!

重定向代​​码:
尝试客户端重定向

args = dict(client_id=FACEBOOK_APP_ID, redirect_uri=base_dir , scope='user_photos,email,offline_access') 
    return render_to_response('fb/nopermission.html', { 'javascript': "<script>window.top.location=\"" + "https://graph.facebook.com/oauth/authorize?" + urllib.urlencode(args)+ "\"</script>" }) 

服务器重定向:

args = dict(client_id=FACEBOOK_APP_ID, redirect_uri=base_dir , scope='user_photos,email,offline_access') 
return HttpResponseRedirect(https://graph.facebook.com/oauth/authorize?" + urllib.urlencode(args)) 

在这两种情况下相同的结果

alt text

+0

你重定向到什么网址? – 2010-08-09 14:42:03

+0

http://*.com/questions/3380876/how-to-authorize-facebook-app-using-redirect-in-canvas/3380939#3380939 – serg 2010-08-09 16:45:41

+0

编辑我的问题 – 2010-08-09 18:45:46

Arrgh! Facebook有这样一个糟糕的文档,我在为它开发时遇到了很多问题。

这一个是因为你不能直接从你的应用程序重定向。使用href链接并将目标属性指定为_top或使用javascript解决此问题。

重定向目的使用此代码:

<html><head> 
<script type="text/javascript"> 
    window.top.location.href = "<?php echo $loginUrl; ?>"; 
</script> 
<noscript> 
    <meta http-equiv="refresh" content="0;url=<?php echo $loginUrl; ?>" /> 
    <meta http-equiv="window-target" content="_top" /> 
</noscript>