Facebook Tab 在经过身份验证的用户的签名请求中丢失页面信息
当查看未经授权的页面时,我的签名请求看起来像这样。
Array (
[algorithm] => HMAC-SHA256
[issued_at] => 1328803958
[page] => Array (
[id] => 114951721840
[liked] => 1
[admin] => 1 )
[user] => Array (
[country] => us
[locale] => en_US
[age] => Array ( [min] => 21 )
)
)
授权应用程序后,初始标签页签名请求如下所示。
Array (
[algorithm] => HMAC-SHA256
[expires] => 1328810400
[issued_at] => 1328804617
[oauth_token] => AAAEQiWKOJTUBAB7la6TzNybfDkv6eYwtGUayappUspm3hWx6qKAFw3Ahbdhqv1xZC27WmrZC0yMMdtE0pdxoiUruZABg1zN1DalnYqS5AZDZD
[page] => Array (
[id] => 114951721840
[liked] => 1
[admin] => 1 )
[user] => Array (
[country] => us
[locale] => en_US
[age] => Array ( [min] => 21 )
)
)
[user_id] => 30811359
)
最后,一旦我离开此页面,签名的请求将如下所示。
Array (
[algorithm] => HMAC-SHA256
[code] => 2.AQAq5nTl5j7tMkqF.3600.1328810400.5-30811359|tXdv-ci5z1GIzo9CY5HXp_piL3I
[issued_at] => 1328804621
[user_id] => 30811359
)
我可以确定用户对有效用户的喜好,但我想弄清楚为什么在从初始选项卡页面导航后会丢失标准签名的请求数据。
更新: 如果我将签名的请求存储到会话变量中并将其加载到后续页面上,则我将维护完整的签名请求。我有理由不应该这样做吗?
My signed request looks like this when viewing a non-authorized page.
Array (
[algorithm] => HMAC-SHA256
[issued_at] => 1328803958
[page] => Array (
[id] => 114951721840
[liked] => 1
[admin] => 1 )
[user] => Array (
[country] => us
[locale] => en_US
[age] => Array ( [min] => 21 )
)
)
After authorizing the app, the initial tab page signed request looks like this.
Array (
[algorithm] => HMAC-SHA256
[expires] => 1328810400
[issued_at] => 1328804617
[oauth_token] => AAAEQiWKOJTUBAB7la6TzNybfDkv6eYwtGUayappUspm3hWx6qKAFw3Ahbdhqv1xZC27WmrZC0yMMdtE0pdxoiUruZABg1zN1DalnYqS5AZDZD
[page] => Array (
[id] => 114951721840
[liked] => 1
[admin] => 1 )
[user] => Array (
[country] => us
[locale] => en_US
[age] => Array ( [min] => 21 )
)
)
[user_id] => 30811359
)
And finally, once I navigate away from this page, the signed request looks like this.
Array (
[algorithm] => HMAC-SHA256
[code] => 2.AQAq5nTl5j7tMkqF.3600.1328810400.5-30811359|tXdv-ci5z1GIzo9CY5HXp_piL3I
[issued_at] => 1328804621
[user_id] => 30811359
)
I can determine user likes with a valid user, but I want to figure out why I lose the standard signed request data after navigating from the initial tab page.
UPDATE :
If I store the signed request into a session variable and load it on subsequent pages, I maintain the full signed request. Is there a reason I should not do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这正是你应该做的。
仅当 Facebook 最初加载 Facebook 选项卡时才会发送签名请求。 Facebook 选项卡中的后续导航不会附带签名请求,因为 Facebook 不再启动页面加载。
That's exactly what you should do.
The signed request is only sent when a Facebook Tab is initially loaded by Facebook. Subsequent navigation within the Facebook Tab doesn't come with a signed request, as Facebook isn't initating the page load any more.
我面临着与“杰里米·琼斯”提到的类似问题。在其他一些帖子中,我发现signed_request应该在
$_REQUEST['signed_request']
返回中。但它对我来说是空的,我得到了$signed_request = $facebook->getSignedRequest();
的一些值,但这里缺少page
数组。I am facing the similar problem as "Jeremy Jones" mentioned. in some other post i found that the signed_request should be in the
$_REQUEST['signed_request']
return. but it is empty for me and i get some value for$signed_request = $facebook->getSignedRequest();
but here thepage
array is missing.