Example #1
0
 /**
  * {@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);
     }
 }
Example #2
0
 /**
  * {@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);
     }
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function validate(Token $token)
 {
     if (null === $token->get($this->claim)) {
         throw new MissingClaim($this->claim, $token);
     }
 }