Skip to content

Commit

Permalink
Merge pull request #2 from mathielen/master
Browse files Browse the repository at this point in the history
Set SessionIndex in SLORequest
  • Loading branch information
tmilos committed May 19, 2016
2 parents 643804d + 7eee5fb commit e7b047d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ private function findParty($entityId, array $entityDescriptorStores)
}
}

return null;
return;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/*
* This file is part of the LightSAML-Logout package.
*
* (c) Milos Tomic <tmilos@lightsaml.com>
*
* 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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,7 +32,6 @@
class SloRequestActionBuilder extends AbstractProfileActionBuilder
{
/**
* @return void
*/
protected function doInitialize()
{
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit e7b047d

Please sign in to comment.