简体   繁体   English

每次Facebook Apps执行操作时都要检查访问令牌的有效性

[英]Check Access Token validity each time Facebook Apps performing action

Is it recommended to check user's Access Token validity EACH time an App is performing a graph request/post/delete action? 是否建议在应用程序执行图形请求/发布/删除操作的每个时间检查用户的访问令牌有效性?

What if an app is performing like 100 request within a minute? 如果某个应用在一分钟内执行了100个请求,该怎么办? Will there be any performance issues? 会不会有性能问题?

No, that's not recommended. 不,不推荐。

If the token is not valid, you will see that from the response you'll be getting from the API anyway – so just make the calls you want to make, and check the return values/catch the exceptions that might get thrown. 如果令牌是无效的,你会看到,从响应你会从API反正让-所以才让你想打的电话,并检查返回值/赶上那可能会引发的异常。


What might be advisable is to check the token's validity once if the user was not active within your app for a longer time, to see whether you have to send them through the login flow again to get a fresh one. 如果用户在应用程序中长时间不活跃,则最好检查令牌的有效性一次 ,以查看是否必须再次通过登录流程发送令牌以获取新令牌。 (But that only applies if you recognize your re-visiting user by any other means than FB login, because if you have already send them through the login flow to identify them again or use the JS SDK to check that for you automatically, you will already have a fresh access token.) (但这仅适用于您通过FB登录以外的任何其他方式识别重新访问用户的情况,因为如果您已经通过登录流程将其发送以再次识别他们,或使用JS SDK为您自动检查,已经有一个新的访问令牌。)

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

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