keylog/core/backends.py

12 lines
341 B
Python
Raw Normal View History

2022-08-12 14:29:55 +00:00
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')