[saml] Replace $_SESSION with DI::session()
parent
b0eb28143a
commit
97fcee53c0
|
@ -117,7 +117,7 @@ function saml_sso_initiate(App $a, array &$b)
|
||||||
|
|
||||||
$auth = new \OneLogin\Saml2\Auth(saml_settings());
|
$auth = new \OneLogin\Saml2\Auth(saml_settings());
|
||||||
$ssoBuiltUrl = $auth->login(null, [], false, false, true);
|
$ssoBuiltUrl = $auth->login(null, [], false, false, true);
|
||||||
$_SESSION['AuthNRequestID'] = $auth->getLastRequestID();
|
DI::session()->set('AuthNRequestID', $auth->getLastRequestID());
|
||||||
header('Pragma: no-cache');
|
header('Pragma: no-cache');
|
||||||
header('Cache-Control: no-cache, must-revalidate');
|
header('Cache-Control: no-cache, must-revalidate');
|
||||||
header('Location: ' . $ssoBuiltUrl);
|
header('Location: ' . $ssoBuiltUrl);
|
||||||
|
@ -129,12 +129,12 @@ function saml_sso_reply(App $a)
|
||||||
$auth = new \OneLogin\Saml2\Auth(saml_settings());
|
$auth = new \OneLogin\Saml2\Auth(saml_settings());
|
||||||
$requestID = null;
|
$requestID = null;
|
||||||
|
|
||||||
if (isset($_SESSION) && isset($_SESSION['AuthNRequestID'])) {
|
if (DI::session()->exists('AuthNRequestID')) {
|
||||||
$requestID = $_SESSION['AuthNRequestID'];
|
$requestID = DI::session()->get('AuthNRequestID');
|
||||||
}
|
}
|
||||||
|
|
||||||
$auth->processResponse($requestID);
|
$auth->processResponse($requestID);
|
||||||
unset($_SESSION['AuthNRequestID']);
|
DI::session()->remove('AuthNRequestID');
|
||||||
|
|
||||||
$errors = $auth->getErrors();
|
$errors = $auth->getErrors();
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ function saml_slo_initiate(App $a, array &$b)
|
||||||
$auth = new \OneLogin\Saml2\Auth(saml_settings());
|
$auth = new \OneLogin\Saml2\Auth(saml_settings());
|
||||||
|
|
||||||
$sloBuiltUrl = $auth->logout();
|
$sloBuiltUrl = $auth->logout();
|
||||||
$_SESSION['LogoutRequestID'] = $auth->getLastRequestID();
|
DI::session()->set('LogoutRequestID', $auth->getLastRequestID());
|
||||||
header('Pragma: no-cache');
|
header('Pragma: no-cache');
|
||||||
header('Cache-Control: no-cache, must-revalidate');
|
header('Cache-Control: no-cache, must-revalidate');
|
||||||
header('Location: ' . $sloBuiltUrl);
|
header('Location: ' . $sloBuiltUrl);
|
||||||
|
@ -194,8 +194,8 @@ function saml_slo_reply()
|
||||||
{
|
{
|
||||||
$auth = new \OneLogin\Saml2\Auth(saml_settings());
|
$auth = new \OneLogin\Saml2\Auth(saml_settings());
|
||||||
|
|
||||||
if (isset($_SESSION) && isset($_SESSION['LogoutRequestID'])) {
|
if (DI::session()->exists('LogoutRequestID')) {
|
||||||
$requestID = $_SESSION['LogoutRequestID'];
|
$requestID = DI::session()->get('LogoutRequestID');
|
||||||
} else {
|
} else {
|
||||||
$requestID = null;
|
$requestID = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue