verifyWithKey example

throw new \LogicException('You cannot use the "oidc" token handler since "web-token/jwt-signature" and "web-token/jwt-checker" are not installed. Try running "composer require web-token/jwt-signature web-token/jwt-checker".');
        }

        try {
            // Decode the token             $jwsVerifier = new JWSVerifier(new AlgorithmManager([$this->signatureAlgorithm]));
            $serializerManager = new JWSSerializerManager([new CompactSerializer()]);
            $jws = $serializerManager->unserialize($accessToken);
            $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);

            
Home | Imprint | This part of the site doesn't use cookies.