From 73d0d205328a0c7df22bae99b3733660fbdbb842 Mon Sep 17 00:00:00 2001 From: deyk Date: Mon, 16 Apr 2012 16:48:37 -0700 Subject: [PATCH 1/1] Added identifier history support to CAS 2.0 validation. `signals.on_cas_collect_histories` now keys off the user, not the email. --- cas_provider/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cas_provider/views.py b/cas_provider/views.py index 68e6784..be6c4d4 100644 --- a/cas_provider/views.py +++ b/cas_provider/views.py @@ -169,7 +169,7 @@ def validate(request): username = ticket.user.username ticket.delete() - results = signals.on_cas_collect_histories.send(sender=validate, for_email=ticket.user.email) + results = signals.on_cas_collect_histories.send(sender=validate, for_user=ticket.user) histories = '\n'.join('\n'.join(rs) for rc, rs in results) logger.info('Validated %s %s', username, "(also %s)" % histories if histories else '') return HttpResponse("yes\n%s\n%s" % (username, histories)) @@ -341,6 +341,8 @@ def auth_success_response(user, pgt, proxies): if custom: attrs.update(custom) + attrs['identifiers'] = [i for r, i in signals.on_cas_collect_histories.send(sender=validate, for_user=user)] + if attrs: formatter = get_callable(settings.CAS_CUSTOM_ATTRIBUTES_FORMATER) formatter(auth_success, attrs) -- 2.20.1