Skip to content

Commit

Permalink
Added SLO with nameID and SessionIndex in demo1
Browse files Browse the repository at this point in the history
  • Loading branch information
pitbulk committed Feb 3, 2015
1 parent 2ff6ba5 commit e755cd8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion demo1/index.php
Expand Up @@ -18,7 +18,18 @@
$returnTo = $spBaseUrl.'/demo1/attrs.php';
$auth->login($returnTo);
} else if (isset($_GET['slo'])) {
$auth->logout();
$returnTo = null;
$paramters = array();
$nameId = null;
$sessionIndex = null;
if (isset($_SESSION['samlNameId'])) {
$nameId = $_SESSION['samlNameId'];
}
if (isset($_SESSION['samlSessionIndex'])) {
$sessionIndex = $_SESSION['samlSessionIndex'];
}

$auth->logout($returnTo, $paramters, $nameId, $sessionIndex);
} else if (isset($_GET['acs'])) {
$auth->processResponse();

Expand All @@ -34,6 +45,8 @@
}

$_SESSION['samlUserdata'] = $auth->getAttributes();
$_SESSION['samlNameId'] = $auth->getNameId();
$_SESSION['samlSessionIndex'] = $auth->getSessionIndex();
if (isset($_POST['RelayState']) && OneLogin_Saml2_Utils::getSelfURL() != $_POST['RelayState']) {
$auth->redirectTo($_POST['RelayState']);
}
Expand Down

0 comments on commit e755cd8

Please sign in to comment.