为什么 Facebook OAuth 令牌会突然失效?
我正在使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能是以下几种情况之一,但如果我不得不冒险猜测,我会说您正在尝试访问会话外的某些内容,并且您的 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.