简体   繁体   English

facebook offline_access

[英]facebook offline_access

ma web application uses the offline_access. ma web应用程序使用offline_access。 As it will be deprecated by the first of may I am wondring how to manage the validity of the access_token. 由于它将在第一时间被弃用,我想知道如何管理access_token的有效性。 In the documentation https://developers.facebook.com/roadmap/offline-access-removal/ they say (If the access_token is generated from a server-side OAuth call, the resulting access_token will have the longer expiration time) ! 在文档https://developers.facebook.com/roadmap/offline-access-removal/中,他们说(如果access_token是从服务器端OAuth调用生成的,则生成的access_token将具有更长的到期时间)! What is this "the longer expiration time?" 什么是“更长的到期时间?” and how I know that my token is not valid anymore? 以及我怎么知道我的令牌不再有效了?

Any one can help me? 任何人都可以帮助我吗? Thanx ! Thanx!

From the page that you linked to in your question, the longer expiration time is 60 days: 从您在问题中链接到的页面,更长的到期时间为60天:

To get the access_token simply pass your own client_id (your app_id), your app_secret, and the client-side access_token to the endpoint below. 要获取access_token,只需将您自己的client_id(您的app_id),您的app_secret和客户端access_token传递给下面的端点。 The returned access_token will be set to expire in 60 days . 返回的access_token将设置为在60天后过期。 If you would like to renew a still valid access_token, you will have to get a new client-side access token first and then call the same endpoint below. 如果您想续订仍然有效的access_token,则必须先获取新的客户端访问令牌,然后再调用下面的相同端点。 The returned access_token with the newly extended expiration time may or may not be the same as the previously granted extended access_token. 具有新延长的到期时间的返回的access_token可以与先前授予的扩展的access_token相同或不同。

And here is how to handle expired access tokens . 以下是如何处理过期的访问令牌

It's nice of Facebook to remove this. 删除这个是很好的Facebook。 Really messes up a lot of our work! 真的搞砸了我们很多工作! Now do you think that having a small windows/unix service running that could call the new end point say every 30 days with the right values would "solve" this. 现在你认为运行一个可以调用新终点的小型windows / unix服务说每30天使用正确的值会“解决”这个问题。 It's not looking like the user has to be physically on your site as the end point is: 看起来用户不必在您的网站上进行实际操作,因为终点是:

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

as you are just calling a URL and parsing the details? 因为您只是调用URL并解析详细信息? So when someone connects to your app, get the new extended access token, save this to your db along with the expires date and with a the right setup up, call the URL every 30 days (or even 59 days if you want to play on the edge...) and up date it without the user ever needing to be physically on your site. 因此,当有人连接到您的应用时,获取新的扩展访问令牌,将其与过期日期一起保存到您的数据库,并通过正确的设置,每30天调用一次URL(如果您想要播放,甚至可以调用59天)边缘...)和更新日期,用户无需身在您的网站上。 Seems like too easy away to get around the security...? 似乎太容易绕过安全......?

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

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