Skip to content

Commit e7b047d

Browse files
committed
Merge pull request #2 from mathielen/master
Set SessionIndex in SLORequest
2 parents 643804d + 7eee5fb commit e7b047d

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

src/LightSaml/Logout/Action/Profile/Outbound/LogoutRequest/ResolveLogoutPartyAction.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@ private function findParty($entityId, array $entityDescriptorStores)
9393
}
9494
}
9595

96-
return null;
96+
return;
9797
}
9898
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the LightSAML-Logout package.
5+
*
6+
* (c) Milos Tomic <[email protected]>
7+
*
8+
* This source file is subject to the GPL-3 license that is bundled
9+
* with this source code in the file LICENSE.
10+
*/
11+
12+
namespace LightSaml\Logout\Action\Profile\Outbound\LogoutRequest;
13+
14+
use LightSaml\Action\Profile\AbstractProfileAction;
15+
use LightSaml\Context\Profile\Helper\MessageContextHelper;
16+
use LightSaml\Context\Profile\ProfileContext;
17+
18+
/**
19+
* Sets SessionIndex of the outbounding AuthnRequest with values given in the LogoutContext SsoSessionState.
20+
*/
21+
class SetSessionIndexAction extends AbstractProfileAction
22+
{
23+
/**
24+
* @param ProfileContext $context
25+
*/
26+
protected function doExecute(ProfileContext $context)
27+
{
28+
$logoutRequest = MessageContextHelper::asLogoutRequest($context->getOutboundContext());
29+
$ssoSessionState = $context->getLogoutSsoSessionState();
30+
31+
$logoutRequest->setSessionIndex($ssoSessionState->getSessionIndex());
32+
}
33+
}

src/LightSaml/Logout/Builder/Action/Profile/SingleLogout/SloRequestActionBuilder.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use LightSaml\Logout\Action\Profile\Outbound\LogoutRequest\ResolveLogoutPartyAction;
2020
use LightSaml\Logout\Action\Profile\Outbound\LogoutRequest\SetNameIdAction;
2121
use LightSaml\Logout\Action\Profile\Outbound\LogoutRequest\SetNotOnOrAfterAction;
22+
use LightSaml\Logout\Action\Profile\Outbound\LogoutRequest\SetSessionIndexAction;
2223
use LightSaml\Action\Profile\Outbound\Message\MessageIdAction;
2324
use LightSaml\Action\Profile\Outbound\Message\MessageIssueInstantAction;
2425
use LightSaml\Action\Profile\Outbound\Message\MessageVersionAction;
@@ -31,7 +32,6 @@
3132
class SloRequestActionBuilder extends AbstractProfileActionBuilder
3233
{
3334
/**
34-
* @return void
3535
*/
3636
protected function doInitialize()
3737
{
@@ -69,6 +69,9 @@ protected function doInitialize()
6969
$proceedActionBuilder->add(new SetNameIdAction(
7070
$this->buildContainer->getSystemContainer()->getLogger()
7171
));
72+
$proceedActionBuilder->add(new SetSessionIndexAction(
73+
$this->buildContainer->getSystemContainer()->getLogger()
74+
));
7275
$proceedActionBuilder->add(new SetNotOnOrAfterAction(
7376
$this->buildContainer->getSystemContainer()->getLogger(),
7477
$this->buildContainer->getSystemContainer()->getTimeProvider(),

0 commit comments

Comments
 (0)