访问令牌的有效期很短,通常只能使用1小时。为了获取新的访问令牌,您需要使用刷新令牌。
第24页
Authorization servers SHOULD issue access tokens with a limited
lifetime and require clients to refresh them by requesting a new
access token using the same assertion if it is still valid.
Otherwise the client MUST obtain a new valid assertion.
通过发送刷新令牌并请求新的访问令牌,这使得认证服务器有机会验证您仍然具有访问权限,且用户尚未撤销您的访问权限。
以下是说明原因:
访问令牌短暂的原因是,如果它们被攻击者攻击,攻击者有限的时间来使用它。它通常会在一小时内过期。
如果刷新令牌被攻击者攻击,则无效,因为黑客无法访问必须同时发送到认证服务器以获取新的访问令牌的客户端ID。