Skip to content
Snippets Groups Projects
Verified Commit ae1e5e70 authored by nd's avatar nd
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
import logging
from django.contrib.auth import load_backend, login
from django.contrib.auth.backends import RemoteUserBackend
class LdapRemoteUserBackend(RemoteUserBackend):
def authenticate(self, request, remote_user=None):
logging.info('auth as %s', remote_user)
ldap_backend = load_backend('django_auth_ldap.backend.LDAPBackend')
combineduser = ldap_backend.populate_user(remote_user)
if combineduser is not None:
login(request, combineduser, backend='django_auth_ldap.backend.LDAPBackend')
logging.debug('loaded data for %s', remote_user)
return combineduser
setup.py 0 → 100644
from setuptools import setup
setup(name='django_auth_ldap_remoteuser',
version='1.0',
description='Combine the RemoteUser and django-auth-ldap backends for django',
url='https://git.cccv.de/infra/uffd/django-auth-ldap-remoteuser',
author='Andreas Valder',
author_email='nd@cccv.de',
license='AGPL3',
packages=['django_auth_ldap_remoteuser'],
zip_safe=False)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment