Kumi
da49ddabcc
Introduce support for Central Authentication Service (CAS) alongside existing OIDC and SAML by integrating a new CAS server app and custom CAS authentication user model. Streamline sign-in infrastructure with updated URL patterns. As part of the update, refactor user model `username` resolution to leverage the email field directly. Includes necessary Django migrations to support new authentication features and removes a deprecated OIDC provider dependency.
12 lines
No EOL
380 B
Python
12 lines
No EOL
380 B
Python
from cas_server.auth import DjangoAuthUser
|
|
|
|
from django.contrib.auth import get_user_model
|
|
|
|
class KumiDCAuthUser(DjangoAuthUser):
|
|
def __init__(self, username):
|
|
User = get_user_model()
|
|
try:
|
|
self.user = User.objects.get_by_natural_key(username)
|
|
except User.DoesNotExist:
|
|
pass
|
|
super(DjangoAuthUser, self).__init__(username) |