Skip to content

Commit 365ee49

Browse files
committed
Fix url decode logout issues with ADFS server
1 parent a1199c5 commit 365ee49

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"require": {
1414
"php": ">=5.4.0",
1515
"illuminate/support": "4.2.*",
16-
"onelogin/php-saml": "2.3"
16+
"onelogin/php-saml": "2.7.0"
1717
},
1818
"autoload": {
1919
"classmap": [

src/Aacotroneo/Saml2/Saml2Auth.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use OneLogin_Saml2_Utils;
88

99
use Log;
10+
use Event;
1011
use Psr\Log\InvalidArgumentException;
1112

1213
class Saml2Auth
@@ -96,20 +97,19 @@ function acs()
9697
* Process a Saml response (assertion consumer service)
9798
* @throws \Exception
9899
*/
99-
function sls()
100+
function sls($retrieveParametersFromServer = false)
100101
{
101102
$auth = $this->auth;
102103

103104
$keep_local_session = true; //we don't touch session here
104-
$auth->processSLO($keep_local_session);
105+
$session_callback = function () {
106+
Event::fire('saml2.logoutRequestReceived');
107+
};
108+
$auth->processSLO($keep_local_session, null, $retrieveParametersFromServer, $session_callback);
105109

106110
$errors = $auth->getErrors();
107111

108-
if (!empty($errors)) {
109-
Log::error("Could not log out", $errors);
110-
throw new \Exception("Could not log out");
111-
}
112-
112+
return $errors;
113113
}
114114

115115
/**

src/config/saml_settings.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@
162162
),
163163
),
164164

165+
'retrieveParametersFromServer' => false,
166+
165167
/* Interoperable SAML 2.0 Web Browser SSO Profile [saml2int] http://saml2int.org/profile/current
166168
167169
'authnRequestsSigned' => false, // SP SHOULD NOT sign the <samlp:AuthnRequest>,

src/controllers/Saml2Controller.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Saml2Auth;
99
use Controller;
1010
use Response;
11+
use Log;
1112

1213

1314
class Saml2Controller extends Controller
@@ -54,8 +55,11 @@ public function acs()
5455
*/
5556
public function sls()
5657
{
57-
Saml2Auth::sls();
58-
Event::fire('saml2.logoutRequestReceived');
58+
$errors = Saml2Auth::sls(Config::get('saml2::settings.retrieveParametersFromServer'));
59+
if (!empty($errors)) {
60+
Log::error("Could not log out", $errors);
61+
throw new \Exception("Could not log out");
62+
}
5963
return Redirect::to(Config::get('saml2::settings.logoutRoute')); //may be set a configurable default
6064
}
6165

0 commit comments

Comments
 (0)