Socket
Socket
Sign inDemoInstall

django-ldap

Package Overview
Dependencies
3
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-ldap

Django LDAP3.


Maintainers
1

Readme

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 NameValue DefaultDescriptionSample
LDAP_HOST"ldap://localhost:389"LDAP Server FDQNLDAP_HOST = "LDAP://localhost:389"
LDAP_TLSFalseWhether to enable secure ldap (note, LDAP and appropriate port should be used in hostname i.e. 636)LDAP_TLS = False
LDAP_TLS_VALIDATEssl.CERT_OPTIONALIf TLS is enabled then the relevant SSL verification code required (either via ssl enum or int)LDAP_TLS_VALIDATE = ssl.CERT_OPTIONAL
LDAP_TLS_VERSIONssl.PROTOCOL_TLSv1If TLS is enabled then the relevant TLS version must be providedLDAP_TLS_VERSION = False
LDAP_BIND_USER_DNNoneDN of Auth User (None for anonymous)LDAP_BIND_USER_DN = "cn=admin,dc=example,dc=com"
LDAP_BIND_PASSNoneAuth User Password (ignored if user DN is None)LDAP_BIND_PASS = "Foo"
LDAP_PAGE_SIZE500Number of elements to return per paged resultLDAP_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_CACHETrueEnables Referral CacheLDAP_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_MODENoneNTLM for Active Directory, SASL for external cert or kerberos, leave as None for other cases, ldap3 will auto choose SIMPLE or ANONYMOUS authLDAP_AUTH_MODE = NTLM

How to contribute

TBD

ensure black formatter is used

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc