diff --git a/src/LightSaml/Logout/Action/Profile/Outbound/LogoutRequest/ResolveLogoutPartyAction.php b/src/LightSaml/Logout/Action/Profile/Outbound/LogoutRequest/ResolveLogoutPartyAction.php index 7476cec..cc4672e 100644 --- a/src/LightSaml/Logout/Action/Profile/Outbound/LogoutRequest/ResolveLogoutPartyAction.php +++ b/src/LightSaml/Logout/Action/Profile/Outbound/LogoutRequest/ResolveLogoutPartyAction.php @@ -93,6 +93,6 @@ private function findParty($entityId, array $entityDescriptorStores) } } - return null; + return; } } diff --git a/src/LightSaml/Logout/Action/Profile/Outbound/LogoutRequest/SetSessionIndexAction.php b/src/LightSaml/Logout/Action/Profile/Outbound/LogoutRequest/SetSessionIndexAction.php new file mode 100644 index 0000000..18f7824 --- /dev/null +++ b/src/LightSaml/Logout/Action/Profile/Outbound/LogoutRequest/SetSessionIndexAction.php @@ -0,0 +1,33 @@ + + * + * This source file is subject to the GPL-3 license that is bundled + * with this source code in the file LICENSE. + */ + +namespace LightSaml\Logout\Action\Profile\Outbound\LogoutRequest; + +use LightSaml\Action\Profile\AbstractProfileAction; +use LightSaml\Context\Profile\Helper\MessageContextHelper; +use LightSaml\Context\Profile\ProfileContext; + +/** + * Sets SessionIndex of the outbounding AuthnRequest with values given in the LogoutContext SsoSessionState. + */ +class SetSessionIndexAction extends AbstractProfileAction +{ + /** + * @param ProfileContext $context + */ + protected function doExecute(ProfileContext $context) + { + $logoutRequest = MessageContextHelper::asLogoutRequest($context->getOutboundContext()); + $ssoSessionState = $context->getLogoutSsoSessionState(); + + $logoutRequest->setSessionIndex($ssoSessionState->getSessionIndex()); + } +} diff --git a/src/LightSaml/Logout/Builder/Action/Profile/SingleLogout/SloRequestActionBuilder.php b/src/LightSaml/Logout/Builder/Action/Profile/SingleLogout/SloRequestActionBuilder.php index a712550..c51ee83 100644 --- a/src/LightSaml/Logout/Builder/Action/Profile/SingleLogout/SloRequestActionBuilder.php +++ b/src/LightSaml/Logout/Builder/Action/Profile/SingleLogout/SloRequestActionBuilder.php @@ -19,6 +19,7 @@ use LightSaml\Logout\Action\Profile\Outbound\LogoutRequest\ResolveLogoutPartyAction; use LightSaml\Logout\Action\Profile\Outbound\LogoutRequest\SetNameIdAction; use LightSaml\Logout\Action\Profile\Outbound\LogoutRequest\SetNotOnOrAfterAction; +use LightSaml\Logout\Action\Profile\Outbound\LogoutRequest\SetSessionIndexAction; use LightSaml\Action\Profile\Outbound\Message\MessageIdAction; use LightSaml\Action\Profile\Outbound\Message\MessageIssueInstantAction; use LightSaml\Action\Profile\Outbound\Message\MessageVersionAction; @@ -31,7 +32,6 @@ class SloRequestActionBuilder extends AbstractProfileActionBuilder { /** - * @return void */ protected function doInitialize() { @@ -69,6 +69,9 @@ protected function doInitialize() $proceedActionBuilder->add(new SetNameIdAction( $this->buildContainer->getSystemContainer()->getLogger() )); + $proceedActionBuilder->add(new SetSessionIndexAction( + $this->buildContainer->getSystemContainer()->getLogger() + )); $proceedActionBuilder->add(new SetNotOnOrAfterAction( $this->buildContainer->getSystemContainer()->getLogger(), $this->buildContainer->getSystemContainer()->getTimeProvider(),