Exemplo n.º 1
0
 /**
  * @return \SpomkyLabs\Jose\Checker\CheckerManagerInterface
  */
 protected function getCheckerManager()
 {
     $checker_manager = new CheckerManager();
     $checker_manager->addChecker(new AudienceChecker('My service'))->addChecker(new CriticalChecker())->addChecker(new ExpirationChecker())->addChecker(new NotBeforeChecker())->addChecker(new IssuedAtChecker());
     return $checker_manager;
 }
Exemplo n.º 2
0
 /**
  *
  */
 private function setCheckerManager()
 {
     $this->container['CheckerManager'] = function ($c) {
         $checker_manager = new CheckerManager();
         $checkers = ['aud' => 'Checker.Audience', 'exp' => 'Checker.IssuedAt', 'iat' => 'Checker.NotBefore', 'crit' => 'Checker.Expiration', 'iss' => 'Checker.Critical'];
         foreach ($checkers as $checker => $service) {
             if (true === $c['Configuration']->get("checker.{$checker}")) {
                 $checker_manager->addChecker($c[$service]);
             }
         }
         return $checker_manager;
     };
     return $this;
 }