简体   繁体   English

从Node续订Facebook访问令牌

[英]Renew facebook access token from Node

In my Node application, I store in the DB a long-lived user facebook access token and run a cron periodically. 在我的Node应用程序中,我将一个长期存在的用户facebook访问令牌存储在数据库中,并定期运行cron。

There's a way to renew that access token after the 60 days without asking the user to renew it in my mobile app? 有没有一种方法可以在60天后续订该访问令牌,而无需要求用户在我的移动应用程序中续订该令牌? I use fbgraph node module to communicate with the graph API, so maybe there's a way to renew that token from the backend itself without going to the mobile app, ask for status and login again with the JavaScript SDK. 我使用fbgraph节点模块与图API进行通信,因此也许有一种方法可以从后端本身更新令牌,而无需转到移动应用程序,询问状态并再次使用JavaScript SDK登录。

Tokens always need to be refreshed with user interaction, there is no way to auto-refresh them. 令牌始终需要通过用户交互来刷新,无法自动刷新它们。

But you don´t need to login again, you just need to use this function to refresh the User Token: https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/ 但您无需再次登录,只需使用此功能即可刷新用户令牌: https : //developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM