コード例 #1
0
ファイル: NotBeforeValidator.php プロジェクト: kbond/php-jwt
 /**
  * {@inheritdoc}
  */
 public function validate(Token $token)
 {
     if (null === $token->notBefore()) {
         throw new MissingClaim(Token::CLAIM_NBF, $token);
     }
     if (false === $token->isAcceptable($this->currentTime)) {
         throw new UnacceptableToken($token);
     }
 }
コード例 #2
0
ファイル: ExpiresAtValidator.php プロジェクト: kbond/php-jwt
 /**
  * {@inheritdoc}
  */
 public function validate(Token $token)
 {
     if (null === $token->expiresAt()) {
         throw new MissingClaim(Token::CLAIM_EXP, $token);
     }
     if ($token->isExpired($this->currentTime)) {
         throw new ExpiredToken($token);
     }
 }
コード例 #3
0
ファイル: HasClaimValidator.php プロジェクト: kbond/php-jwt
 /**
  * {@inheritdoc}
  */
 public function validate(Token $token)
 {
     if (null === $token->get($this->claim)) {
         throw new MissingClaim($this->claim, $token);
     }
 }