From 5cda351b4c80a35ad83d0e3fa294ba2e07820352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Schneider?= Date: Wed, 8 Oct 2014 19:08:49 +0200 Subject: [PATCH] fix idp initiated logout --- conf.d/biblio | 2 +- conf.d/espace_famille | 2 +- mandaye_vincennes/filters/vincennes.py | 3 --- mandaye_vincennes/mappers/biblio_vincennes.py | 13 ++++++++----- mandaye_vincennes/mappers/duonet_vincennes.py | 9 ++------- mandaye_vincennes/mappers/famille_vincennes.py | 14 ++++++++------ 6 files changed, 20 insertions(+), 23 deletions(-) diff --git a/conf.d/biblio b/conf.d/biblio index a2d8e0a..dfd7c04 100644 --- a/conf.d/biblio +++ b/conf.d/biblio @@ -8,5 +8,5 @@ "saml2_idp_metadata": "http://authentic.local/idp/saml2/metadata", "saml2_signature_public_key": "certs/saml.crt", "saml2_signature_private_key": "certs/saml.key", - "sp_logout_url": "/sezhame/mandayelogout" + "sp_logout_url": "/sezhame/logout" } diff --git a/conf.d/espace_famille b/conf.d/espace_famille index 16f1379..6d495da 100644 --- a/conf.d/espace_famille +++ b/conf.d/espace_famille @@ -8,5 +8,5 @@ "saml2_idp_metadata": "http://authentic.local/idp/saml2/metadata", "saml2_signature_public_key": "certs/saml.crt", "saml2_signature_private_key": "certs/saml.key", - "sp_logout_url": "/vincennes-noredirect/mandayelogout" + "sp_logout_url": "/vincennes-noredirect/deconnexion.do" } diff --git a/mandaye_vincennes/filters/vincennes.py b/mandaye_vincennes/filters/vincennes.py index 2cee234..00e9e8c 100644 --- a/mandaye_vincennes/filters/vincennes.py +++ b/mandaye_vincennes/filters/vincennes.py @@ -13,9 +13,6 @@ from mandaye.template import serve_template from mandaye.backends.default import Association -def local_logout(env, values, request, response): - return _302(config.template_vars.get('wcs_url'), response.cookies) - def get_associate_form(env, values): """ Return association template content """ diff --git a/mandaye_vincennes/mappers/biblio_vincennes.py b/mandaye_vincennes/mappers/biblio_vincennes.py index 49f8334..bf0e023 100644 --- a/mandaye_vincennes/mappers/biblio_vincennes.py +++ b/mandaye_vincennes/mappers/biblio_vincennes.py @@ -1,4 +1,5 @@ +from mandaye import config from mandaye.auth.saml2 import END_POINTS_PATH from mandaye_vincennes.filters import vincennes @@ -73,12 +74,14 @@ mapping = [ } }, { - 'path': r'/sezhame/mandayelogout$', + 'path': r'%s$' % END_POINTS_PATH['single_logout_return'], 'method': 'GET', - 'target': '/sezhame/logout', - 'on_response': [{ - 'filter': vincennes.local_logout, - }] + 'response': { + 'auth': 'single_logout_return', + 'values': { + 'next_url': config.template_vars.get('wcs_url') + } + } }, { 'path': r'/mandaye/associate$', diff --git a/mandaye_vincennes/mappers/duonet_vincennes.py b/mandaye_vincennes/mappers/duonet_vincennes.py index 1ccf00a..bc1ea21 100644 --- a/mandaye_vincennes/mappers/duonet_vincennes.py +++ b/mandaye_vincennes/mappers/duonet_vincennes.py @@ -1,4 +1,5 @@ +from mandaye import config from mandaye.auth.saml2 import END_POINTS_PATH from mandaye_vincennes.filters import vincennes @@ -82,16 +83,10 @@ mapping = [ 'response': { 'auth': 'single_logout_return', 'values': { - 'next_url': '/mandayelogout', + 'next_url': config.template_vars.get('wcs_url') } } }, - { - 'path': r'/mandayelogout$', - 'method': 'GET', - 'target': '/Connect.aspx?key=%s' % duonet_key, - 'on_response': [{'filter': vincennes.local_logout}] - }, { 'path': r'/mandaye/sso$', 'method': 'GET', diff --git a/mandaye_vincennes/mappers/famille_vincennes.py b/mandaye_vincennes/mappers/famille_vincennes.py index 7045fb0..10fcbe1 100644 --- a/mandaye_vincennes/mappers/famille_vincennes.py +++ b/mandaye_vincennes/mappers/famille_vincennes.py @@ -1,4 +1,5 @@ +from mandaye import config from mandaye.auth.saml2 import END_POINTS_PATH from mandaye_vincennes.filters import vincennes @@ -91,14 +92,15 @@ mapping = [ } }, { - 'path': r'%s/mandayelogout$' % folder_target, + 'path': r'%s$' % END_POINTS_PATH['single_logout_return'], 'method': 'GET', - 'target': '%s/deconnexion.do' % folder_target, - 'on_response': [{ - 'filter': vincennes.local_logout, - }] + 'response': { + 'auth': 'single_logout_return', + 'values': { + 'next_url': config.template_vars.get('wcs_url') + } + } }, - { 'path': r'/mandaye/disassociate$', 'method': 'GET',