12 lines
341 B
Python
12 lines
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')
|