Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger CKAN failed login signal #105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ckanext/saml2auth/views/saml2auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down
Loading