www-bocal/bocal_auth/cas_backend.py
Théophile Bastian 865a249002 Fix first CAS connection problem
`user` was not returned by configure_user
2017-10-15 17:09:14 +02:00

13 lines
366 B
Python

from django_cas_ng.backends import CASBackend
from .models import CasUser
class BOcalCASBackend(CASBackend):
# Partly from Robin Champenois's "ExperiENS". Thanks!
def clean_username(self, username):
return username.lower().strip()
def configure_user(self, user):
casUser = CasUser(user=user)
casUser.save()
return user