Skip to content

Commit

Permalink
Merge pull request #1 from lixinhan/deception-prevention
Browse files Browse the repository at this point in the history
增加验证,防止jwt token 二段信息 被恶意篡改,欺骗服务端
  • Loading branch information
kanyxmo authored Apr 8, 2023
2 parents df5ec04 + 6c6073b commit abf114a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Util/JWTUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public static function getValidationData(Signer $signer, Key $key, string $token
}

$config->setValidationConstraints(new \Lcobucci\JWT\Validation\Constraint\IdentifiedBy($claims['jti']));
$config->setValidationConstraints(new \Lcobucci\JWT\Validation\Constraint\SignedWith($signer,$key));

if (! $config->validator()->validate($parser, ...$config->validationConstraints())) {
return false;
Expand Down

0 comments on commit abf114a

Please sign in to comment.