website/kumisystems/auth.py
Kumi 81115792b7
Add OIDC
Sample settings file
2023-07-08 16:51:05 +02:00

9 lines
No EOL
309 B
Python

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')