Exemplo n.º 1
0
 /**
  * @param string $entityId
  *
  * @return CredentialInterface[]
  */
 public function getByEntityId($entityId)
 {
     $entityDescriptor = $this->entityDescriptorProvider->get($entityId);
     if (false == $entityDescriptor) {
         return array();
     }
     return $this->extractCredentials($entityDescriptor);
 }
 /**
  * @param ProfileContext                 $context
  * @param EntityDescriptorStoreInterface $entityDescriptorProvider
  * @param string                         $entityId
  *
  * @return \LightSaml\Model\Metadata\EntityDescriptor
  */
 protected function getPartyEntityDescriptor(ProfileContext $context, EntityDescriptorStoreInterface $entityDescriptorProvider, $entityId)
 {
     $partyEntityDescriptor = $entityDescriptorProvider->get($entityId);
     if (null === $partyEntityDescriptor) {
         $message = sprintf("Unknown issuer '%s'", $entityId);
         $this->logger->emergency($message, LogHelper::getActionErrorContext($context, $this));
         throw new LightSamlContextException($context, $message);
     }
     return $partyEntityDescriptor;
 }
 /**
  * @param AssertionContext $context
  *
  * @return void
  */
 protected function doExecute(AssertionContext $context)
 {
     if (null === $context->getAssertion()->getIssuer()) {
         $message = 'Assertion element must have an issuer element';
         $this->logger->error($message, LogHelper::getActionErrorContext($context, $this));
         throw new LightSamlContextException($context, $message);
     }
     if (false == $this->idpEntityDescriptorProvider->has($context->getAssertion()->getIssuer()->getValue())) {
         $message = sprintf("Unknown issuer '%s'", $context->getAssertion()->getIssuer()->getValue());
         $this->logger->error($message, LogHelper::getActionErrorContext($context, $this, ['messageIssuer' => $context->getAssertion()->getIssuer()->getValue()]));
         throw new LightSamlContextException($context, $message);
     }
     $this->logger->debug(sprintf('Known assertion issuer: "%s"', $context->getAssertion()->getIssuer()->getValue()), LogHelper::getActionContext($context, $this));
 }