Upse singleLogout by redirect with sessionIndex usage

* larpe/saml2.ptl:
   use sessionIndex to find a session when logout by redirect does not
   give the right session.

git-svn-id: svn+ssh://labs.libre-entreprise.org/svnroot/larpe@479 3ed937ae-f919-0410-9a43-8e6f19e4ba6e
This commit is contained in:
bdauvergne 2009-09-28 13:25:27 +00:00
parent b54fb9e091
commit 6fc7839442
1 changed files with 11 additions and 5 deletions

View File

@ -338,14 +338,20 @@ class Saml2(Saml2Directory):
# its browser configured so that cookies are not sent for
# remote queries and IdP is using image-based SLO.
# so we look up a session with the appropriate name identifier
name_identifier = logout.nameIdentifier.content
# find a matching
for session in get_session_manager().values():
# This block differs from qommon
user = session.get_user(logout.server.providerId)
if user and logout.nameIdentifier.content in user.name_identifiers:
session_index = session.lasso_session_indexes.get(providerId)
name_identifier = session.lasso_session_name_identifiers.get(providerId)
request_name_identifier = logout.nameIdentifier.content
request_session_index = logout.request.sessionIndex
if request_name_identifier == name_identifier and \
(not session_index or request_session_index == session_index):
get_logger().info('SLO/SOAP from %s' % logout.remoteProviderId)
break
else:
session = get_session()
# no session, build straight failure answer
logout.buildResponseMsg()
return logout.msgBody
return self.slo_idp(logout, session)