You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You might also want to give your iat, exp and nbf checks some kind of leeway to account for skewed clocks. You can do this by passing a `leeway` parameter like this:
tryvalidateDate(claims, key:"exp", comparison:.orderedAscending, failure:.expiredSignature, decodeError:"Expiration time claim (exp) must be an integer")
tryvalidateDate(claims, key:"exp", comparison:.orderedAscending,leeway:(-1* leeway),failure:.expiredSignature, decodeError:"Expiration time claim (exp) must be an integer")
136
136
}
137
137
138
-
publicfunc validateNotBefore()throws{
139
-
tryvalidateDate(claims, key:"nbf", comparison:.orderedDescending, failure:.immatureSignature, decodeError:"Not before claim (nbf) must be an integer")
tryvalidateDate(claims, key:"nbf", comparison:.orderedDescending,leeway: leeway,failure:.immatureSignature, decodeError:"Not before claim (nbf) must be an integer")
140
140
}
141
141
142
-
publicfunc validateIssuedAt()throws{
143
-
tryvalidateDate(claims, key:"iat", comparison:.orderedDescending, failure:.invalidIssuedAt, decodeError:"Issued at claim (iat) must be an integer")
tryvalidateDate(claims, key:"iat", comparison:.orderedDescending,leeway: leeway,failure:.invalidIssuedAt, decodeError:"Issued at claim (iat) must be an integer")
0 commit comments