diff --git a/src/SAML2/Entity/ServiceProvider.php b/src/SAML2/Entity/ServiceProvider.php index 844d987d7..838214ed2 100644 --- a/src/SAML2/Entity/ServiceProvider.php +++ b/src/SAML2/Entity/ServiceProvider.php @@ -54,7 +54,7 @@ final class ServiceProvider protected SignatureAlgorithmFactory $signatureAlgorithmFactory; protected EncryptionAlgorithmFactory $encryptionAlgorithmFactory; protected KeyTransportAlgorithmFactory $keyTransportAlgorithmFactory; - + protected bool $responseWasSigned; /** * @param bool $encryptedAssertions Whether assertions must be encrypted @@ -160,7 +160,8 @@ public function receiveResponse(ServerRequestInterface $request): Response } // Verify the signature (if any) - $verifiedResponse = $rawResponse->isSigned() ? $this->verifyElementSignature($rawResponse) : $rawResponse; + $this->responseWasSigned = $rawResponse->isSigned(); + $verifiedResponse = $this->responseWasSigned ? $this->verifyElementSignature($rawResponse) : $rawResponse; $state = null; $stateId = $verifiedResponse->getInResponseTo();