From c613c9de67c944b939d6d07856f5ea63f0b78348 Mon Sep 17 00:00:00 2001 From: avdata99 Date: Fri, 26 Jul 2024 15:39:22 -0300 Subject: [PATCH] Trigger CKAN failed login signal --- ckanext/saml2auth/views/saml2auth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ckanext/saml2auth/views/saml2auth.py b/ckanext/saml2auth/views/saml2auth.py index 36a6c0f..70d4fef 100644 --- a/ckanext/saml2auth/views/saml2auth.py +++ b/ckanext/saml2auth/views/saml2auth.py @@ -28,7 +28,7 @@ import ckan.model as model import ckan.plugins as plugins import ckan.lib.dictization.model_dictize as model_dictize -from ckan.lib import base +from ckan.lib import base, signals from ckan.views.user import set_repoze_user from ckan.common import config, g, request @@ -227,6 +227,8 @@ def acs(): if error is not None: log.error(error) extra_vars = {u'code': [400], u'content': error} + # Trigger the CKAN failed login signal + signals.failed_login.send('Unknown_SAML2_user') return base.render(u'error_document_template.html', extra_vars), 400 auth_response.get_identity()