To enable LDAP you’ll need to specify which components of the LDAP authentication backend are enabled. In the settings.py add the following to either Authentication, User Provider, Group Provider slugs.:
'tardis.tardis_portal.auth.ldap_auth.ldap_auth'
This is a wrapper function that allows initialisation of the LDAP provider using settings.py values.
Return an initialised LDAP backend.
The following are configuration settings that are used when initialising the LDAP backend.
Enable TLS connections.
Set the URL of the LDAP server, e.g. ldap://localhost:389/
Set the login attribute of the users, usually this will be either cn or uid
The LDAP user attribute map is used to map internal identifiers like display and email to their LDAP equivalents e.g. {“givenName”: “display”, “mail”: “email”}
This is where you specify the group identifier from LDAP, usually it will be cn.
This map is used to map internal identifiers like display e.g. {“description”: “display”}
Sets the search base of the LDAP queries dc=example, dc=com
Sets the search base of user related LDAP queries e.g. “ou=People, ” + LDAP_BASE
Sets the search base of group related LDAP queries e.g. “ou=Group, ” + LDAP_BASE
return the group associated with the id:
{"id": 123,
“display”: “Group Name”,}
return an iteration of the available groups.
return a list of groups associated with a particular entity id
return the user dictionary in the format of:
{"id": 123,
“display”: “John Smith”, “email”: “john@example.com“}