getIssuers() public method

Gets the Issuers (from Response and Assertion).
public getIssuers ( ) : array
return array @issuers The issuers of the assertion/response
Example #1
0
 /**
  * Tests the getIssuers method of the OneLogin_Saml2_Response
  *
  * @covers OneLogin_Saml2_Response::getIssuers
  */
 public function testGetIssuers()
 {
     $xml = file_get_contents(TEST_ROOT . '/data/responses/adfs_response.xml.base64');
     $response = new OneLogin_Saml2_Response($this->_settings, $xml);
     $this->assertEquals(array('http://login.example.com/issuer'), $response->getIssuers());
     $xml2 = file_get_contents(TEST_ROOT . '/data/responses/valid_encrypted_assertion.xml.base64');
     $response2 = new OneLogin_Saml2_Response($this->_settings, $xml2);
     $this->assertEquals(array('http://idp.example.com/'), $response2->getIssuers());
     $xml3 = file_get_contents(TEST_ROOT . '/data/responses/double_signed_encrypted_assertion.xml.base64');
     $response3 = new OneLogin_Saml2_Response($this->_settings, $xml3);
     $this->assertEquals(array('https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php', 'http://idp.example.com/'), $response3->getIssuers());
     $xml4 = file_get_contents(TEST_ROOT . '/data/responses/invalids/no_issuer_response.xml.base64');
     $response4 = new OneLogin_Saml2_Response($this->_settings, $xml4);
     try {
         $issuers = $response4->getIssuers();
     } catch (Exception $e) {
         $this->assertContains('Issuer of the Response not found or multiple.', $e->getMessage());
     }
     $xml5 = file_get_contents(TEST_ROOT . '/data/responses/invalids/no_issuer_assertion.xml.base64');
     $response5 = new OneLogin_Saml2_Response($this->_settings, $xml5);
     try {
         $issuers = $response5->getIssuers();
     } catch (Exception $e) {
         $this->assertContains('Issuer of the Assertion not found or multiple.', $e->getMessage());
     }
 }
Example #2
0
 /**
  * Tests the getIssuers method of the OneLogin_Saml2_Response
  *
  * @covers OneLogin_Saml2_Response::getIssuers
  */
 public function testGetIssuers()
 {
     $xml = file_get_contents(TEST_ROOT . '/data/responses/response1.xml.base64');
     $response = new OneLogin_Saml2_Response($this->_settings, $xml);
     $this->assertEquals(array('https://app.onelogin.com/saml/metadata/13590'), $response->getIssuers());
     $xml2 = file_get_contents(TEST_ROOT . '/data/responses/valid_encrypted_assertion.xml.base64');
     $response2 = new OneLogin_Saml2_Response($this->_settings, $xml2);
     $this->assertEquals(array('http://idp.example.com/'), $response2->getIssuers());
     $xml3 = file_get_contents(TEST_ROOT . '/data/responses/double_signed_encrypted_assertion.xml.base64');
     $response3 = new OneLogin_Saml2_Response($this->_settings, $xml3);
     $this->assertEquals(array('https://pitbulk.no-ip.org/simplesaml/saml2/idp/metadata.php', 'http://idp.example.com/'), $response3->getIssuers());
 }