Skip to main content

Django LDAP3.

Project description

Django LDAP

This library provides LDAP3 integration for Django, its purpose is to wrap the ldap3 library and provide useful helpers for searching and manipulating a given directory.

This library intends on becoming a full-fledged authentication backend for Django in coming updates.

Requirements

  • Django 2.2+
  • Python 3.7+

Installation

  1. Install the library
$ pip install django-ldap
  1. Add "django_ldap" to your INSTALLED_APPS setting
    installed_apps

  2. Add "django_ldap.backend.LDAPBackend" as an AUTHENTICATION_BACKENDS i.e.

AUTHENTICATION_BACKENDS = [
    # ...
    'django_ldap.backend.LDAPBackend',
    # ...
]

auth_backend

  1. Add the following configuration items to your settings.py as a minimum LDAP_HOST = "LDAP://<LDAP_SERVER_HOSTNAME>:<LDAP_SERVER_PORT>"

Additional Configuration Parameters

Key Name Value Default Description Sample
LDAP_HOST "ldap://localhost:389" LDAP Server FDQN LDAP_HOST = "LDAP://localhost:389"
LDAP_TLS False Whether to enable secure ldap (note, LDAP and appropriate port should be used in hostname i.e. 636) LDAP_TLS = False
LDAP_TLS_VALIDATE ssl.CERT_OPTIONAL If TLS is enabled then the relevant SSL verification code required (either via ssl enum or int) LDAP_TLS_VALIDATE = ssl.CERT_OPTIONAL
LDAP_TLS_VERSION ssl.PROTOCOL_TLSv1 If TLS is enabled then the relevant TLS version must be provided LDAP_TLS_VERSION = False
LDAP_BIND_USER_DN None DN of Auth User (None for anonymous) LDAP_BIND_USER_DN = "cn=admin,dc=example,dc=com"
LDAP_BIND_PASS None Auth User Password (ignored if user DN is None) LDAP_BIND_PASS = "Foo"
LDAP_PAGE_SIZE 500 Number of elements to return per paged result LDAP_PAGE_SIZE = 500
LDAP_SEARCH_ROOT "dc=example,dc=com" LDAP tree root (Used for search when left as default) LDAP_SEARCH_ROOT = "dc=example,dc=com"
LDAP_ENABLE_REF_CACHE True Enables Referral Cache LDAP_ENABLE_REF_CACHE = True
LDAP_SET_LDAP3_ARGS {} Allows LDAP3 global parameters to be updated (see LDAP3 Global Config ) LDAP_SET_LDAP3_ARGS = {'SOCKET_SIZE': 4096}
LDAP_AUTH_MODE None NTLM for Active Directory, SASL for external cert or kerberos, leave as None for other cases, ldap3 will auto choose SIMPLE or ANONYMOUS auth LDAP_AUTH_MODE = NTLM

How to contribute

TBD

ensure black formatter is used

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-ldap-0.0.8.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_ldap-0.0.8-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file django-ldap-0.0.8.tar.gz.

File metadata

  • Download URL: django-ldap-0.0.8.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for django-ldap-0.0.8.tar.gz
Algorithm Hash digest
SHA256 568387c5cf484557a95360fb41e88a2332ac290578a3e75da55e0f45bbc2a8a2
MD5 81f7a2f6131683cde04d05eed8c31567
BLAKE2b-256 756a4fb080d9f3fd9aade7ac1039656a1e6fa8bc0a42fa2bf4d78c90a4f7bce2

See more details on using hashes here.

File details

Details for the file django_ldap-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: django_ldap-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for django_ldap-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5620125931f949e3c7c11b6ccf58a58a8f39de4fbab072d803d25bbc0e6e6b88
MD5 666ca87addc46f7e219d0aee58d3909a
BLAKE2b-256 8db86d20537b191dd7e840a85abd3904bb6b23b8a0ee930025b8db6fb14c83bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page