예제 #1
0
 /**
  * @test
  */
 public function shouldAllowGetSPProviderWithValueFromConstructor()
 {
     $si = new ServiceInfo($expectedProviderID = 'main', $expectedIDPID = 'idp', $expectedSPProvider = $this->createEntityDescriptorProviderMock(), $expectedIDPProvider = $this->createEntityDescriptorProviderMock(), $expectedSPMeta = $this->createSpMetaProviderMock(), $expectedSigning = $this->createSPSigningProviderMock());
     $this->assertEquals($expectedSPProvider, $si->getSpProvider());
 }
 /**
  * @param ServiceInfo $serviceInfo
  * @return LogoutRequestBuilder
  */
 protected function createLogoutRequestBuilder(ServiceInfo $serviceInfo)
 {
     $builder = new LogoutRequestBuilder($serviceInfo->getSpProvider()->getEntityDescriptor(), $serviceInfo->getIdpProvider()->getEntityDescriptor(), $serviceInfo->getSpMetaProvider()->getSpMeta());
     return $builder;
 }
예제 #3
0
 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()));
         }
     }
 }