java - 扩展 Facebook 访问 token 的服务器端非用户交互方式

标签 java facebook-graph-api

我有一个 Web 应用程序,用户可以将我们的网站链接到他们的 Facebook 帐户,以便我们可以将内容发布到他们的墙和粉丝页面。我们之前使用的是offline_access 参数,但现在它已停用,并且我们所有用户的访问 token 将在 60 天后过期。在我看来,我们所有的用户都必须在 60 天后重新链接他们的 Facebook 帐户。有什么方法可以自动刷新访问 token 而无需用户交互吗?

最佳答案

据我了解,目前任何访问 token 的最长生命周期都是 60 天。用户必须每 60 天周期重新验证您的 Facebook 应用程序(或者如果他们因任何其他原因删除访问权限)。

Even the long-lived access token will eventually expire. At any point, you can generate a new long-lived token by sending the person back to the login flow used by your app - note that the person will not actually need to login again, they have already authorized your app, so they will immediately redirect back to your app from the login flow with a refreshed token - how this appears to the person will vary based on the type of login flow that you are using, for example if you are using the JavaScript SDK, this will take place in the background, if you are using a server-side flow, the browser will quickly redirect to the Login Dialog and then automatically and immediately back to your app again.

来源:

http://developers.facebook.com/roadmap/offline-access-removal/ http://developers.facebook.com/docs/facebook-login/access-tokens/#extending

关于java - 扩展 Facebook 访问 token 的服务器端非用户交互方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17199338/

相关文章:

facebook - Facebook Canvas 应用程序是否需要登录按钮?

ios - Facebook sdk 不从 ios 应用程序发布图片

java - 我可以同时在不同端口上运行selenium服务器吗?

java - 检测两个字符串是否有一个字符不同的最佳方法是什么?

java - Spring FTP 入站与出站 channel 适配器

facebook - 使用 Graph API 获取用户在 Facebook 中拥有的页面列表

facebook-graph-api - 获取发布在页面墙/提要上的高分辨率照片

ios - Facebook AppLink 和 iOS : can't retrieve custom deep link URL query parameters

java - 尝试返回字符串数组列表中的中间值

java - 格式化秒表以显示 00 :00