Jose\Object\JWTInterface::getClaim PHP Method

getClaim() public method

Returns the value of the payload of the specified key.
public getClaim ( string $key ) : mixed | null
$key string The key
return mixed | null Payload value
    public function getClaim($key);

Usage Example

Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function checkClaim(JWTInterface $jwt)
 {
     if (!$jwt->hasClaim('iat')) {
         return [];
     }
     $iat = (int) $jwt->getClaim('iat');
     Assertion::lessOrEqualThan($iat, time(), 'The JWT is issued in the future.');
     return ['iat'];
 }
All Usage Examples Of Jose\Object\JWTInterface::getClaim