Skip to content

Commit ae9ff12

Browse files
committed
Fix #50. Do accesible the ID of the object Logout Request (id attribute)
1 parent 984365d commit ae9ff12

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ else:
591591
if not keep_local_session:
592592
OneLogin_Saml2_Utils.delete_local_session(delete_session_cb)
593593

594-
in_response_to = OneLogin_Saml2_Logout_Request.get_id(request)
594+
in_response_to = request.id
595595
response_builder = OneLogin_Saml2_Logout_Response(self.__settings)
596596
response_builder.build(in_response_to)
597597
logout_response = response_builder.get_response()
@@ -748,7 +748,7 @@ SAML 2 Logout Request class
748748

749749
* `__init__` Constructs the Logout Request object.
750750
* ***get_request*** Returns the Logout Request defated, base64encoded.
751-
* ***get_id*** Returns the ID of the Logout Request.
751+
* ***get_id*** Returns the ID of the Logout Request. (If you have the object you can access to the id attribute)
752752
* ***get_nameid_data*** Gets the NameID Data of the the Logout Request (returns a dict).
753753
* ***get_nameid*** Gets the NameID of the Logout Request Message (returns a string).
754754
* ***get_issuer*** Gets the Issuer of the Logout Request Message.
@@ -875,7 +875,7 @@ toolkit on it in development mode executing this:
875875
Using this method of deployment the toolkit files will be linked instead of
876876
copied, so if you make changes on them you won't need to reinstall the toolkit.
877877

878-
If you want install it in a nomal mode, execute:
878+
If you want install it in a normal mode, execute:
879879
```
880880
python setup.py install
881881
```

src/onelogin/saml2/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def process_slo(self, keep_local_session=False, request_id=None, delete_session_
141141
if not keep_local_session:
142142
OneLogin_Saml2_Utils.delete_local_session(delete_session_cb)
143143

144-
in_response_to = OneLogin_Saml2_Logout_Request.get_id(OneLogin_Saml2_Utils.decode_base64_and_inflate(self.__request_data['get_data']['SAMLRequest']))
144+
in_response_to = logout_request.id
145145
response_builder = OneLogin_Saml2_Logout_Response(self.__settings)
146146
response_builder.build(in_response_to)
147147
logout_response = response_builder.get_response()

src/onelogin/saml2/logout_request.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,16 @@ def __init__(self, settings, request=None, name_id=None, session_index=None):
4747
"""
4848
self.__settings = settings
4949
self.__error = None
50+
self.id = None
5051

5152
if request is None:
5253
sp_data = self.__settings.get_sp_data()
5354
idp_data = self.__settings.get_idp_data()
5455
security = self.__settings.get_security_data()
5556

5657
uid = OneLogin_Saml2_Utils.generate_unique_id()
58+
self.id = uid
59+
5760
issue_instant = OneLogin_Saml2_Utils.parse_time_to_SAML(OneLogin_Saml2_Utils.now())
5861

5962
cert = None
@@ -105,6 +108,7 @@ def __init__(self, settings, request=None, name_id=None, session_index=None):
105108
logout_request = inflated
106109
except Exception:
107110
logout_request = decoded
111+
self.id = self.get_id(logout_request)
108112

109113
self.__logout_request = logout_request
110114

0 commit comments

Comments
 (0)