mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-11-15 05:12:38 +01:00
When the flag is on and an OIDC provider is configured, every e-mail and password check is refused: the login page, the admin and the API's basic auth. OIDC logins, API tokens, OAuth apps and permission checks keep working. The login page hides the password form.
15 lines
588 B
Python
15 lines
588 B
Python
from allauth.account.auth_backends import AuthenticationBackend
|
|
|
|
|
|
class SocialOnlyAuthenticationBackend(AuthenticationBackend):
|
|
"""Replaces the default backends when OIDC_DISABLE_LOCAL_LOGIN is on.
|
|
|
|
Every e-mail and password is refused, wherever it's checked: the login
|
|
page, the admin and the API's basic auth. OIDC logins still work, because
|
|
allauth picks its own backend class, which this is, for those sessions.
|
|
Permission checks keep working too, since they come from ModelBackend.
|
|
"""
|
|
|
|
def authenticate(self, request, **credentials):
|
|
return None
|