website/kumisystems/auth.py

9 lines
309 B
Python
Raw Permalink Normal View History

2023-07-08 14:51:05 +00:00
from mozilla_django_oidc.auth import OIDCAuthenticationBackend
class OIDCBackend(OIDCAuthenticationBackend):
def create_user(self, claims):
email = claims.get('email')
return self.UserModel.objects.create_user(email)
def get_username(self, claims):
return claims.get('email')