authentication - 刷新 token 是否与请求 token 相同?

标签 authentication oauth oauth-2.0 google-api

关于 http://code.google.com/apis/accounts/docs/OAuth2.html Google 区分两种 token :刷新 token 和访问 token 。刷新 token 是否与更传统的请求 token 相同?在 http://oauth.net/core/1.0/我找不到任何地方提到的刷新 token 。或者,它是 OAuth2.0 的新功能吗?

最佳答案

访问 token 会在短时间(我猜是 3600 秒)后过期。

如果您想在用户离线后访问他的帐户,您需要一个刷新 token 。 旧访问 token 过期后,您可以交换刷新 token 以获取新的访问 token 。

来自您提供的链接

Access tokens have a limited lifetime and, in some cases, an application needs access to a Google API beyond the lifetime of a single access token. When this is the case, your application can obtain what is called a refresh token. A refresh token allows your application to obtain new access tokens.

即仅当您需要离线访问时才需要刷新 token ,否则您不需要全部。它是可选的。

查看此链接,它将提供有关刷新 token 的所有内容。

http://code.google.com/apis/accounts/docs/OAuth2WebServer.html

关于authentication - 刷新 token 是否与请求 token 相同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8961792/

相关文章:

Grails + Spring 安全 : unable to login

javascript - Soundcloud Javascript API - 连接 window.opener.setTimeout() 不工作

node.js - 404 未从 Azure AD-OAuth/PassportJS 中的重定向URL 找到

grails - 禁止使用具有相同用户但使用多个设备的OAuth2登录请求

asp.net - 通过 Google OAuth2 登录时设置 User.Identity.Name

java - Spring安全OAuth 2

java - 无法在 Spring LDAP 中进行身份验证

.net - 序列化/反序列化 GenericXmlSecurityToken 和安全性 - CRM Auth

php - CakePHP 3 - 多字段身份验证登录

email - 如何使用 Oauth2 阅读用户的 Outlook 电子邮件?