为什么 Facebook OAuth 令牌会突然失效?

发布于 2024-09-14 13:29:04 字数 278 浏览 4 评论 0原文

我正在使用 Facebook 的 PHP SDK,到目前为止效果非常好。但是,我在一页上遇到了一个奇怪的问题。在此页面上,我调用图形 API,然后使用 FQL 进行调用。然而,在第二次调用时,我收到“无效的 OAuth 2.0 访问令牌”异常。为什么第一次调用有效时令牌会失效?我还在网站的其他地方使用 FQL(相同的查询/代码),而且效果很好。有谁知道什么会导致这个?

更新:第一个调用是图形调用 (/me?fields=email)..第二个调用是查询当前用户的从属关系(如果有帮助)。

I'm using Facebook's PHP SDK, and it's been great so far. However, I have a weird issue on one page. On this page, I make a call to the graph API, then later a call using FQL. On the second call, however, I get an "Invalid OAuth 2.0 Access Token" exception. Why would the token become invalid while the first call worked? I also use FQL (same exact query/code) elsewhere in my site, and it works just fine. Does anyone know what would cause this?

Update: First call is a graph call (/me?fields=email).. second is querying for current user's affiliation, if that helps.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

青衫负雪 2024-09-21 13:29:04

可能是以下几种情况之一,但如果我不得不冒险猜测,我会说您正在尝试访问会话外的某些内容,并且您的 oauth 令牌不包含 offline_access 正在访问的资源的权限。

也许有关 API 调用/FQL 查询性质的更多详细信息将帮助我们缩小范围。

Could be one of several things, but if I had to hazard a guess, I'd say that you're trying to access something out-of-session, and your oauth token doesn't include the offline_access permission for the resource being accessed.

Perhaps some more detail about the nature of your API calls/FQL queries would help us narrow it down.

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