Skip to content

Commit e755cd8

Browse files
committed
Added SLO with nameID and SessionIndex in demo1
1 parent 2ff6ba5 commit e755cd8

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

demo1/index.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,18 @@
1818
$returnTo = $spBaseUrl.'/demo1/attrs.php';
1919
$auth->login($returnTo);
2020
} else if (isset($_GET['slo'])) {
21-
$auth->logout();
21+
$returnTo = null;
22+
$paramters = array();
23+
$nameId = null;
24+
$sessionIndex = null;
25+
if (isset($_SESSION['samlNameId'])) {
26+
$nameId = $_SESSION['samlNameId'];
27+
}
28+
if (isset($_SESSION['samlSessionIndex'])) {
29+
$sessionIndex = $_SESSION['samlSessionIndex'];
30+
}
31+
32+
$auth->logout($returnTo, $paramters, $nameId, $sessionIndex);
2233
} else if (isset($_GET['acs'])) {
2334
$auth->processResponse();
2435

@@ -34,6 +45,8 @@
3445
}
3546

3647
$_SESSION['samlUserdata'] = $auth->getAttributes();
48+
$_SESSION['samlNameId'] = $auth->getNameId();
49+
$_SESSION['samlSessionIndex'] = $auth->getSessionIndex();
3750
if (isset($_POST['RelayState']) && OneLogin_Saml2_Utils::getSelfURL() != $_POST['RelayState']) {
3851
$auth->redirectTo($_POST['RelayState']);
3952
}

0 commit comments

Comments
 (0)