facebook - 访问 token 过期未延长

标签 facebook authentication facebook-oauth facebook-authentication

我可以获得有效期为 60 天的访问 token ,但无法延长到期时间。我这样做是为了能够通过单个用户访问 Facebook 页面。这是我的过程。

我调用: https://www.facebook.com/dialog/oauth?response_type=token&client_id=APP_ID&scope=read_stream,publish_stream,manage_pages,read_insights,create_event&redirect_uri=REDIRECT_URL

然后我使用从上面的 URL 获得的 token 调用这个 URL: https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=fb_exchange_token&fb_exchange_token=EXISTING_ACCESS_TOKEN

这个周末我已经尝试了多次,在每一个实例中,我都获得了相同的访问 token ,但过期时间没有更新。我通过在浏览器中访问 URL 来完成此操作。

我是否遗漏了任何能够续期的东西?

最佳答案

我认为页面管理员用户必须在 60 天内返回您的应用程序才能获得带有延长时间的新访问 token 。我认为您不能(或不应该)被允许仅通过应用程序扩展访问 token 。

参见:https://developers.facebook.com/docs/offline-access-deprecation/

Note: The user must access your application before you're able to get a valid "authorization code" to be able to make the server-side oAuth call again. Apps will not be able to setup a background/cron job that tries to automatically extend the expiration time, because the "authorization code" is short-lived and will have expired.

关于facebook - 访问 token 过期未延长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9163432/

相关文章:

没有全局范围的 Laravel 身份验证

node.js - Passport-Facebook 不提供电子邮件,即使它在范围内

javascript - 输入凭据后 Facebook Oauth 登录弹出窗口卡住

android - 一般如何停止 AsyncFacebookRunner 或停止请求?

php - Facebook 标记视频

Facebook oauth 授权 URL 和参数选项

oauth - oAuth用来记住用户的标准是什么?

php - Facebook 自动发布链接在手机上以 map 形式打开

android - 如何在 Android 的 Firebase 身份验证中更改登录的电话号码?

带有 Auth0 路由错误 404 的 Angular 2