douxinghuai3150 2011-07-13 14:24 采纳率: 0%
浏览 39
已采纳

Facebook问题:无法在未经授权的情况下将用户ID转入iframe

I have a facebook page with an iframe app.

I want it to be able to work in the same way as http://www.facebook.com/pepsi With the following user journey.

  1. User goes app tab on my page.
  2. User is prompted with a page, partial content, that invites to click the like button
  3. User clicks like and is shown full content.

all this is done without the client needing to login or authenticate.

My problem is that facebook is not passing me the user id.

I have tried var_dump($_REQUEST); and var_dump($fb->fb_params); to see if user id is there but nothing.

I dont think php sdk 3.0 or oauth works for signed_request

Can someone tell me how I get the user id from facebook without login?

thanks

  • 写回答

1条回答 默认 最新

  • dtv7174 2011-07-13 14:30
    关注

    Unless the user grants your application permission, the signed request will not contain their user id. See the docs for signed request.

    If the user has not authorized your application, your application will only be passed a subset of the above information.

    This includes the user object (although it'd be nice if Facebook specifically mentioned what data is or is not passed for unauthorized users - I banged my head against the wall for a bit trying to figure this out.)

    That being said, you don't need a user to be authorized in order to "like-gate" a page.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?