duanlinghe8417 2010-04-30 21:19
浏览 39

facebook权限对话框php-sdk在iframe应用程序中着色

I'am having trouble with facebook php-sdk new api, permission window. I am using facebook connect inside the facebook iframe application.

e-profpy app @ Facebook

When I try to login with following url, login windows laying out well inside facebook application but permission diolog is being overlayed by shaded screen.

What can cause this ? I am using only php no javascript facebook api.

Thanks

  • 写回答

2条回答 默认 最新

  • douseda0009 2010-05-03 20:58
    关注

    I had the same problem. To fix it, you'll need to use JS to redirect the user to the FB authorization page, then let FB pass the authenticated user back to your app page. You don't need to use the JS API for this.

    • First, check the FB applications settings and make sure that your "Post-Authorize Redirect URL" is set to your Canvas Page URL. (e.g. http://apps.facebook.com/[YOUR APP]/)

    • Then handle your authentication like this:

      $session = $facebook->getSession(); $me = null; if ($session){ try { $uid = $facebook->getUser(); $me = $facebook->api('/me'); } catch (FacebookApiException $e) { error_log($e); } }

      if ($me) { $logoutUrl = $facebook->getLogoutUrl(); } else { $loginUrl = $facebook->getLoginUrl( array('next'=>"http://apps.facebook.com/[YOUR APP]/")); }

      if (!$me){ print("[html][head]");
      print("[script type=\"text/javascript\"]function redirect(){ top.location.href = \"");
      print($loginUrl);
      print("\"; }[/script][/head]");
      print("[body onload=\"redirect();\"]Please wait...[/body][/html]"); exit(); }

    ( i dunno how to make tags appear here, so i used square brackets. you'll want to replace those)

    评论

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型