コード例 #1
0
ファイル: IssuerChecker.php プロジェクト: rwx-zwx-awx/jose
 /**
  * {@inheritdoc}
  */
 public function checkJWT(JWTInterface $jwt)
 {
     $iss = $jwt->getIssuer();
     if (!is_null($iss) && !in_array($iss, $this->issuers)) {
         throw new \Exception('Issuer not allowed.');
     }
     return $this;
 }
コード例 #2
0
ファイル: SubjectChecker.php プロジェクト: rwx-zwx-awx/jose
 /**
  * {@inheritdoc}
  */
 public function checkJWT(JWTInterface $jwt)
 {
     $sub = $jwt->getIssuer();
     if (!is_null($sub) && !$this->isSubjectValid($sub)) {
         throw new \Exception('Invalid subject.');
     }
     return $this;
 }