任何 ID 令牌的过期时间小于刷新令牌的过期时间都意味着您最终会拥有一个过期的 ID 令牌,但是有效的访问令牌。
那么你应该:
"The current time MUST be before the time represented by the exp Claim."
可能支持上述第三个选项。
EDIT
由于OpenID Connect是基于OAuth2构建的,因此可以在OAuth2规范中找到下面附加问题的答案,该规范表示:
expires_in
RECOMMENDED. The lifetime in seconds of the access token.
相关问题是当你用授权码交换令牌时,同一规范称您可能会收到类似以下的响应:
{
"access_token": "SlAV32hkKG",
"token_type": "Bearer",
"refresh_token": "8xLOxBtZp8",
"expires_in": 3600,
"id_token": "eyJhbG[...]"
}
但在这种情况下,“expires_in”与什么相关?访问令牌,刷新令牌还是ID令牌?
(请注意,IdentityServer3 将其设置为访问令牌的过期时间)。