-
Notifications
You must be signed in to change notification settings - Fork 145
Description
when trigger /saml2/logout. It returns following exceptions:
File "/root/anaconda3/envs/archery/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
return handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/archery/lib/python3.11/site-packages/djangosaml2/views.py", line 707, in get
result = client.global_logout(subject_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/archery/lib/python3.11/site-packages/saml2/client.py", line 217, in global_logout
entity_ids = self.users.issuers_of_info(name_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/archery/lib/python3.11/site-packages/saml2/population.py", line 44, in issuers_of_info
return self.cache.entities(name_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/anaconda3/envs/archery/lib/python3.11/site-packages/saml2/cache.py", line 156, in entities
cni = code(name_id)
^^^^^^^^^^^^^
File "/root/anaconda3/envs/archery/lib/python3.11/site-packages/saml2/ident.py", line 41, in code
val = getattr(item, attr)
^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'name_qualifier'
2025年07月07日 21:52:05,081 - djangosaml2 - WARNING - The session does not contain the subject id for user
i found out, when trigger /saml2/login, set subject id was successful. But logout can get it from saml_session. Is there any config about this?
def _set_subject_id(session, subject_id):
session["_saml2_subject_id"] = code(subject_id)
def _get_subject_id(session):
try:
return decode(session["_saml2_subject_id"])
except KeyError:
return None