diff options
author | Andrew Wason <rectalogic@rectalogic.com> | 2021-09-10 17:24:29 -0400 |
---|---|---|
committer | Andrew Wason <rectalogic@rectalogic.com> | 2021-09-10 17:57:14 -0400 |
commit | d83525262ec7f573abc852c7a0d33a968caaddd5 (patch) | |
tree | 25e9bffe6b26e14197181f7afd2b6d856adc005b /src | |
parent | f0a6d63c315e5ec0a47419d28720f25ceb359212 (diff) | |
download | pysaml2-d83525262ec7f573abc852c7a0d33a968caaddd5.tar.gz |
Handle KeyError when retrieving SessionIndex
This was broken in commit b69e92585
Fixes https://github.com/IdentityPython/pysaml2/issues/826
Diffstat (limited to 'src')
-rw-r--r-- | src/saml2/client.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/saml2/client.py b/src/saml2/client.py index 61d81502..aa0bd0c9 100644 --- a/src/saml2/client.py +++ b/src/saml2/client.py @@ -294,9 +294,12 @@ class Saml2Client(Base): ) continue - session_info = self.users.get_info_from(name_id, entity_id, False) - session_index = session_info.get('session_index') - session_indexes = [session_index] if session_index else None + try: + session_info = self.users.get_info_from(name_id, entity_id, False) + session_index = session_info.get('session_index') + session_indexes = [session_index] if session_index else None + except KeyError: + session_indexes = None sign = sign if sign is not None else self.logout_requests_signed sign_post = sign and ( |