|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
from importlib import import_module |
|
|
|
|
|
|
|
|
|
from django.contrib.auth import BACKEND_SESSION_KEY |
|
|
|
|
from django.conf import settings |
|
|
|
|
from django.contrib.auth import user_logged_in |
|
|
|
|
from django.core.cache import cache |
|
|
|
@ -24,14 +25,17 @@ def on_user_auth_login_success(sender, user, request, **kwargs):
|
|
|
|
|
|
|
|
|
|
@receiver(openid_user_login_success) |
|
|
|
|
def on_oidc_user_login_success(sender, request, user, **kwargs): |
|
|
|
|
request.session[BACKEND_SESSION_KEY] = 'OIDCAuthCodeBackend' |
|
|
|
|
post_auth_success.send(sender, user=user, request=request) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@receiver(openid_user_login_failed) |
|
|
|
|
def on_oidc_user_login_failed(sender, username, request, reason, **kwargs): |
|
|
|
|
request.session[BACKEND_SESSION_KEY] = 'OIDCAuthCodeBackend' |
|
|
|
|
post_auth_failed.send(sender, username=username, request=request, reason=reason) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@receiver(cas_user_authenticated) |
|
|
|
|
def on_cas_user_login_success(sender, request, user, **kwargs): |
|
|
|
|
post_auth_success.send(sender, user=user, request=request) |
|
|
|
|
request.session[BACKEND_SESSION_KEY] = 'CASBackend' |
|
|
|
|
post_auth_success.send(sender, user=user, request=request) |
|
|
|
|