Skip to content

Commit f8ed7fc

Browse files
authored
Merge pull request #186 from LukasReschke/add-invalid-entity-id-to-exception
Add invalid entityId to Exception
2 parents 2963ee4 + f3fc3b1 commit f8ed7fc

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/Saml2/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function isValid($requestId = null)
256256
$trimmedIssuer = trim($issuer);
257257
if (empty($trimmedIssuer) || $trimmedIssuer !== $idPEntityId) {
258258
throw new OneLogin_Saml2_ValidationError(
259-
"Invalid issuer in the Assertion/Response",
259+
"Invalid issuer in the Assertion/Response (expected '$idPEntityId', got '$trimmedIssuer')",
260260
OneLogin_Saml2_ValidationError::WRONG_ISSUER
261261
);
262262
}

tests/src/OneLogin/Saml2/ResponseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,12 +952,12 @@ public function testIsInValidIssuer()
952952
$response3 = new OneLogin_Saml2_Response($this->_settings, $message);
953953

954954
$this->assertFalse($response3->isValid());
955-
$this->assertEquals('Invalid issuer in the Assertion/Response', $response3->getError());
955+
$this->assertEquals('Invalid issuer in the Assertion/Response (expected \'http://idp.example.com/\', got \'http://invalid.issuer.example.com/\')', $response3->getError());
956956

957957
$response4 = new OneLogin_Saml2_Response($this->_settings, $message2);
958958

959959
$this->assertFalse($response4->isValid());
960-
$this->assertEquals('Invalid issuer in the Assertion/Response', $response4->getError());
960+
$this->assertEquals('Invalid issuer in the Assertion/Response (expected \'http://idp.example.com/\', got \'http://invalid.isser.example.com/\')', $response4->getError());
961961
}
962962

963963
/**

0 commit comments

Comments
 (0)