JWSTokenSupport example

$claims = json_decode($jws->getPayload(), true);

            // Verify the signature             if (!$jwsVerifier->verifyWithKey($jws$this->jwk, 0)) {
                throw new InvalidSignatureException();
            }

            // Verify the headers             $headerCheckerManager = new Checker\HeaderCheckerManager([
                new Checker\AlgorithmChecker([$this->signatureAlgorithm->name()]),
            ][
                new JWSTokenSupport(),
            ]);
            // if this check fails, an InvalidHeaderException is thrown             $headerCheckerManager->check($jws, 0);

            // Verify the claims             $checkers = [
                new Checker\IssuedAtChecker(0, false, $this->clock),
                new Checker\NotBeforeChecker(0, false, $this->clock),
                new Checker\ExpirationTimeChecker(0, false, $this->clock),
                new Checker\AudienceChecker($this->audience),
                new Checker\IssuerChecker($this->issuers),
            ];
Home | Imprint | This part of the site doesn't use cookies.