keylog/core/backends.py
2022-08-12 14:29:55 +00:00

12 lines
No EOL
341 B
Python

from mozilla_django_oidc.auth import OIDCAuthenticationBackend
from .models.auth import User
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')