Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Update custom Django authentication backend to get the credentials from the query strings
import ...
class AuthenticationBackend(ModelBackend):
def authenticate(self, request, username=None, password=None, **kwargs):
# Get credentials from the query strings
username = request.GET.get('username')
password = request.GET.get('password')
# Check that the user can authenticate in the LDAP using its username and password
if get_LDAP_user(username, password) is None:
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment