File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -389,12 +389,15 @@ TLoginProvider::TValidateTokenResponse TLoginProvider::ValidateToken(const TVali
389
389
auto keyId = FromStringWithDefault<ui64>(decoded_token.get_key_id ());
390
390
const TKeyRecord* key = FindKey (keyId);
391
391
if (key != nullptr ) {
392
+ static const size_t ISSUED_AT_LEEWAY_SEC = 2 ;
392
393
auto verifier = jwt::verify ()
393
- .allow_algorithm (jwt::algorithm::ps256 (key->PublicKey ));
394
+ .allow_algorithm (jwt::algorithm::ps256 (key->PublicKey ))
395
+ .issued_at_leeway (ISSUED_AT_LEEWAY_SEC);
394
396
if (Audience) {
395
397
// jwt.h require audience claim to be a set
396
398
verifier.with_audience (std::set<std::string>{Audience});
397
399
}
400
+
398
401
verifier.verify (decoded_token);
399
402
response.User = decoded_token.get_subject ();
400
403
response.ExpiresAt = decoded_token.get_expires_at ();
You can’t perform that action at this time.
0 commit comments