访问令牌具有offline_access权限的到期时间 [英] Access Token expire time with offline_access permission

查看:1624
本文介绍了访问令牌具有offline_access权限的到期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook权限页面说明关于offline_access的以下内容:

Facebook Permissions page states the following about offline_access:


使您的应用程序代表
执行授权请求随时。默认情况下,大多数访问令牌在
短时间段之后到期,以确保只有在积极使用该应用程序时,应用程序才会以
的形式向用户发出请求。这个
权限使得我们的OAuth端点
长寿命返回的访问令牌。

Enables your application to perform authorized requests on behalf of the user at any time. By default, most access tokens expire after a short time period to ensure applications only make requests on behalf of the user when the are actively using the application. This permission makes the access token returned by our OAuth endpoint long-lived.

然后我看到这个主题 http://developers.facebook.com/docs/authentication/

尝试这个:

https://graph.facebook.com/oauth/access_token

 client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&
 client_secret=YOUR_APP_SECRET&code=THE_CODE_FROM_ABOVE

这个没有offline_access权限的url响应如下: / p>

This url without offline_access permission responding like this:

access_token=.....&expires=5462

但是,offline_access权限只响应access_token。我没有得到这个,Facebook说它的长寿,但是活着多久?

But with offline_access permission responding just access_token. I dont get this, facebook says its long-lived but how long lived?

如何在使用offline_access权限到期访问令牌时学习?

How can I learn when expires access token with offline_access permission?

推荐答案

使用offline_access权限时返回的访问令牌永远不会过期。

Access tokens returned when using the offline_access permission never expire.

编辑:根据文档令牌是长寿命。我假设你只需要处理他们不再工作的情况(如果甚至发生)。

According to the documentation the tokens are 'long-lived'. I'm assuming you will just have to handle the scenario where they no longer work (if that even happens).

这篇关于访问令牌具有offline_access权限的到期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆