/**
  * @param ProfileContext $context
  *
  * @return void
  */
 protected function doExecute(ProfileContext $context)
 {
     $authnRequest = MessageContextHelper::asAuthnRequest($context->getInboundContext());
     if (false == $authnRequest->getAssertionConsumerServiceURL()) {
         return;
     }
     $spEntityDescriptor = $context->getPartyEntityDescriptor();
     foreach ($spEntityDescriptor->getAllSpSsoDescriptors() as $sp) {
         if ($sp->getAllAssertionConsumerServicesByUrl($authnRequest->getAssertionConsumerServiceURL())) {
             $this->logger->debug(sprintf('AuthnRequest has assertion consumer url "%s" that belongs to entity "%s"', $authnRequest->getAssertionConsumerServiceURL(), $spEntityDescriptor->getEntityID()), LogHelper::getActionContext($context, $this));
             return;
         }
     }
     $message = sprintf("Invalid ACS Url '%s' for '%s' entity", $authnRequest->getAssertionConsumerServiceURL(), $spEntityDescriptor->getEntityID());
     $this->logger->emergency($message, LogHelper::getActionErrorContext($context, $this));
     throw new LightSamlValidationException($message);
 }
Ejemplo n.º 2
0
 /**
  * @param ProfileContext $context
  */
 protected function doExecute(ProfileContext $context)
 {
     $response = MessageContextHelper::asResponse($context->getInboundContext());
     $this->sessionProcessor->processAssertions($response->getAllAssertions(), $context->getOwnEntityDescriptor()->getEntityID(), $context->getPartyEntityDescriptor()->getEntityID());
 }
Ejemplo n.º 3
0
 public function test__get_party_entity_descriptor_returns_from_context()
 {
     $profileContext = new ProfileContext(Profiles::METADATA, ProfileContext::ROLE_IDP);
     $profileContext->getPartyEntityContext()->setEntityDescriptor($expectedValue = new EntityDescriptor());
     $this->assertSame($expectedValue, $profileContext->getPartyEntityDescriptor());
 }