我有一个具有以下有效负载的JWT:
{
"id": "394a71988caa6cc30601e43f5b6569d52cd7f6df",
"jti": "394a71988caa6cc30601e43f5b6569d52cd7f6df",
"iss": "issuer_id",
"aud": "client_id",
"sub": "user_id",
"exp": 1483711650,
"iat": 1483708050,
"token_type": "bearer",
"scope": "onescope twoscope"
}iat :时代发行
例:到期于时代
我现在想检查一下令牌的生命周期。
有人能建议贝斯韦这么做吗?
发布于 2019-12-11 04:40:37
long currentTimeEpocSec = Instant.now().getEpochSecond()然后用当前时间减去过期时间,以秒为单位给出持续时间。
long duration = expiresAt - currentTimeEpocSec;几秒之内
long durationInMinutes = duration / 60;https://stackoverflow.com/questions/59158307
复制相似问题