Beispiel #1
0
 public function validate(SAML2_Response $response, SAML2_Response_Validation_Result $result)
 {
     $destination = $response->getDestination();
     if (!$this->expectedDestination->equals(new SAML2_Configuration_Destination($destination))) {
         $result->addError(sprintf('Destination in response "%s" does not match the expected destination "%s"', $destination, $this->expectedDestination));
     }
 }
Beispiel #2
0
 /**
  * @group response-validation
  * @test
  */
 public function the_result_correctly_reports_whether_or_not_it_is_valid()
 {
     $result = new SAML2_Response_Validation_Result();
     $this->assertTrue($result->isValid());
     $this->assertCount(0, $result->getErrors());
     $result->addError('Oh noooos!');
     $this->assertFalse($result->isValid());
     $this->assertCount(1, $result->getErrors());
 }
Beispiel #3
0
 public function validate(SAML2_Response $response, SAML2_Response_Validation_Result $result)
 {
     if (!$response->isSuccess()) {
         $result->addError($this->buildMessage($response->getStatus()));
     }
 }
 public static function createFromValidationResult(SAML2_Response_Validation_Result $result)
 {
     $message = sprintf('Cannot process response, preconditions not met: "%s"', implode('", "', $result->getErrors()));
     return new self($message);
 }