Skip to content

Commit 5d6315a

Browse files
committed
Do accesible the ID of the object Logout Request (id attribute)
1 parent 0e2e7fd commit 5d6315a

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ if (!OneLogin_Saml2_LogoutRequest::isValid($this->_settings, $request)) {
758758
OneLogin_Saml2_Utils::deleteLocalSession();
759759
}
760760

761-
$inResponseTo = OneLogin_Saml2_LogoutRequest::getID($request);
761+
$inResponseTo = $request->id;
762762
$responseBuilder = new OneLogin_Saml2_LogoutResponse($this->_settings);
763763
$responseBuilder->build($inResponseTo);
764764
$logoutResponse = $responseBuilder->getResponse();
@@ -1020,7 +1020,7 @@ SAML 2 Logout Request class
10201020

10211021
* **OneLogin_Saml2_LogoutRequest** Constructs the Logout Request object.
10221022
* **getRequest** Returns the Logout Request defated, base64encoded, unsigned
1023-
* **getID** Returns the ID of the Logout Request.
1023+
* **getID** Returns the ID of the Logout Request. (If you have the object you can access to the id attribute)
10241024
* **getNameIdData** Gets the NameID Data of the the Logout Request.
10251025
* **getNameId** Gets the NameID of the Logout Request.
10261026
* **getIssuer** Gets the Issuer of the Logout Request.

lib/Saml2/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function processSLO($keepLocalSession = false, $requestId = null, $retrie
149149
if (!$keepLocalSession) {
150150
OneLogin_Saml2_Utils::deleteLocalSession();
151151
}
152-
$inResponseTo = OneLogin_Saml2_LogoutRequest::getID(gzinflate(base64_decode($_GET['SAMLRequest'])));
152+
$inResponseTo = $logoutRequest->id;
153153
$responseBuilder = new OneLogin_Saml2_LogoutResponse($this->_settings);
154154
$responseBuilder->build($inResponseTo);
155155
$logoutResponse = $responseBuilder->getResponse();

lib/Saml2/LogoutRequest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
*/
77
class OneLogin_Saml2_LogoutRequest
88
{
9+
10+
/**
11+
* Contains the ID of the Logout Request
12+
* @var string
13+
*/
14+
public $id;
15+
916
/**
1017
* Object that represents the setting info
1118
* @var OneLogin_Saml2_Settings
@@ -45,6 +52,8 @@ public function __construct(OneLogin_Saml2_Settings $settings, $request = null,
4552
$security = $this->_settings->getSecurityData();
4653

4754
$id = OneLogin_Saml2_Utils::generateUniqueID();
55+
$this->id = $id;
56+
4857
$nameIdValue = OneLogin_Saml2_Utils::generateUniqueID();
4958
$issueInstant = OneLogin_Saml2_Utils::parseTime2SAML(time());
5059

@@ -91,6 +100,7 @@ public function __construct(OneLogin_Saml2_Settings $settings, $request = null,
91100
} else {
92101
$logoutRequest = $decoded;
93102
}
103+
$this->id = self::getID($logoutRequest);
94104
}
95105
$this->_logoutRequest = $logoutRequest;
96106
}

0 commit comments

Comments
 (0)