Skip to content

holgersielaff/django-ldap3-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

django-ldap3-auth

Installation:

  1. Place this File into lib/ or anywhere else

  2. In settings.py:

AUTHENTICATION_BACKENDS = [
    'lib.Ldap3AuthBackend.Ldap3AuthBackend',
    # ^------------- or anywhere else
    'django.contrib.auth.backends.ModelBackend',
    # '...',
]

What this Backend does:

  1. It tries to bind and whoami to <LDAP_HOST> with given Credentials
  2. It searches in <LDAP_GROUPS> for groupOfName members
  3. It checks if user is in one of these members lists
  4. It syncs the groups to Database
  5. It assigns the appropriate group(s) to user

If no user exists in db - it will be created

One of the following Configurations must be set

1. Configfile - only with appropriate config Class (TODO)

A Configfile just as

{
  "ldap-auth": {
    "host": "...",
    "port": 389,
    "base_dn": "...",
    "users_basedn": "...",
    "groups_dn": "..."
  }
}
2. in settings.py
LDAP_AUTH_HOST = '...'
LDAP_AUTH_GROUP_DN = '...'
LDAP_AUTH_USER_BASEDN = '...'
LDAP_AUTH_PORT = 389
3. ENV Vars
export LDAP_AUTH_HOST='...'
export LDAP_AUTH_GROUP_DN='...'
export LDAP_AUTH_USER_BASEDN='...'
export LDAP_AUTH_PORT=389

or sourced from somewhere

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages