Moved azure login to local app. Removed ability for new users to be created automatically

This commit is contained in:
John Mullins
2023-12-15 15:00:41 +11:00
parent 7519585c84
commit 1240ab2538
9 changed files with 247 additions and 3 deletions
+14
View File
@@ -0,0 +1,14 @@
from django.contrib.auth.backends import ModelBackend
from .handlers import AuthHandler
class AzureBackend(ModelBackend):
def authenticate(self, request, token=None, *args, **kwargs):
if not token: # pragma: no cover
return
user = AuthHandler(request).authenticate(token)
# Return only if `is_active`
if self.user_can_authenticate(user):
return user