/**
  * @param ProfileContext $context
  */
 protected function doExecute(ProfileContext $context)
 {
     $logoutRequest = MessageContextHelper::asLogoutRequest($context->getOutboundContext());
     $ssoSessionState = $context->getLogoutSsoSessionState();
     $nameId = new NameID();
     $nameId->setValue($ssoSessionState->getNameId());
     $nameId->setFormat($ssoSessionState->getNameIdFormat());
     $logoutRequest->setNameID($nameId);
 }
 private function getPartyEntityDescriptor(ProfileContext $context)
 {
     $ssoSessionState = $context->getLogoutSsoSessionState();
     $ownEntityId = $context->getOwnEntityDescriptor()->getEntityID();
     $partyId = $ssoSessionState->getOtherPartyId($ownEntityId);
     $partyEntityDescriptor = $this->findParty($partyId, [$this->idpEntityDescriptorStore, $this->spEntityDescriptorStore]);
     if ($partyEntityDescriptor) {
         return $partyEntityDescriptor;
     }
     throw new LightSamlContextException($context, sprintf('Unknown party "%s"', $partyId));
 }
 protected function getDescriptorType(ProfileContext $context)
 {
     $ssoSessionState = $context->getLogoutSsoSessionState();
     $ownEntityId = $context->getOwnEntityDescriptor()->getEntityID();
     if ($ssoSessionState->getIdpEntityId() == $ownEntityId) {
         return SpSsoDescriptor::class;
     } elseif ($ssoSessionState->getSpEntityId() == $ownEntityId) {
         return IdpSsoDescriptor::class;
     } else {
         throw new LightSamlContextException($context, 'Unable to resolve logout target descriptor type');
     }
 }
예제 #4
0
 public function test__get_logout_sso_session_state_returns_from_context()
 {
     $profileContext = new ProfileContext(Profiles::METADATA, ProfileContext::ROLE_IDP);
     $profileContext->getLogoutContext()->setSsoSessionState($expectedValue = new SsoSessionState());
     $this->assertSame($expectedValue, $profileContext->getLogoutSsoSessionState());
 }
 /**
  * @param ProfileContext $context
  */
 protected function doExecute(ProfileContext $context)
 {
     $logoutRequest = MessageContextHelper::asLogoutRequest($context->getOutboundContext());
     $ssoSessionState = $context->getLogoutSsoSessionState();
     $logoutRequest->setSessionIndex($ssoSessionState->getSessionIndex());
 }