Example #1
0
 /**
  * @param \DOMElement $xml
  * @throws \AerialShip\LightSaml\Error\InvalidXmlException
  */
 function loadFromXml(\DOMElement $xml)
 {
     parent::loadFromXml($xml);
     $this->iterateChildrenElements($xml, function (\DOMElement $node) {
         if ($node->localName == 'Assertion' && $node->namespaceURI == Protocol::NS_ASSERTION) {
             $assertion = new Assertion();
             $assertion->loadFromXml($node);
             $this->addAssertion($assertion);
         }
     });
 }
 protected function validateSubjectConfirmationRecipient(Assertion $assertion, ServiceInfo $serviceInfo)
 {
     $arrACS = $serviceInfo->getSpProvider()->getEntityDescriptor()->getFirstSpSsoDescriptor()->findAssertionConsumerServices();
     foreach ($assertion->getSubject()->getSubjectConfirmations() as $subjectConfirmation) {
         $ok = false;
         foreach ($arrACS as $acs) {
             if ($acs->getLocation() == $subjectConfirmation->getData()->getRecipient()) {
                 $ok = true;
                 break;
             }
         }
         if (!$ok) {
             throw new AuthenticationException(sprintf('Invalid Assertion SubjectConfirmation Recipient %s', $subjectConfirmation->getData()->getRecipient()));
         }
     }
 }