Facebook Tab 在经过身份验证的用户的签名请求中丢失页面信息

发布于 2025-01-04 09:54:26 字数 1315 浏览 0 评论 0原文

当查看未经授权的页面时,我的签名请求看起来像这样。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心是晴朗的。 2025-01-11 09:54:26

更新:如果我将签名的请求存储到会话变量中并将其加载到后续页面上,我将维护完整的签名请求。我有什么理由不应该这样做吗?

这正是你应该做的。

仅当 Facebook 最初加载 Facebook 选项卡时才会发送签名请求。 Facebook 选项卡中的后续导航不会附带签名请求,因为 Facebook 不再启动页面加载。

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?

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.

本宫微胖 2025-01-11 09:54:26

我面临着与“杰里米·琼斯”提到的类似问题。在其他一些帖子中,我发现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 the page array is missing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文