duandongjin5647 2012-04-11 08:03
浏览 51
已采纳

Facebook - 通过Cronjob获取用户访问令牌

is it possible to get an valid access token for an user via a cronjob? i want to create an app that parse every night all posts from the user and check if there are some special chars.

with the app access key i have only access to the public posts from the user.. with the user access token i can access also private posts

but the user access token expires

is it possible to refresh the user token with an cronjob? that means the cronjob may have to refresh 100 user access tokens and i dont have the user du open the authorization dialog because its called on a server via cronjob

I'am using php for the facebook api

  • 写回答

2条回答 默认 最新

  • dongyiluan1718 2012-04-11 08:11
    关注

    No, this is not possible, it even say that explicitly in the official Removal of offline_access Permission post:

    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.

    With that said, when you get an access token from a Server-Side authentication flow, the token you get should last for a month, if you persist it then you can then use it for that month.

    After that month is over, and if the user hasn't re-engaged your app then the access token will be expired and you'll have to pass on that user.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog