tardis.tardis_portal.auth.ldap_auth – LDAP Authentication

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.

ldap_auth() Function

tardis.tardis_portal.auth.ldap_auth.ldap_auth()

Return an initialised LDAP backend.

The following are configuration settings that are used when initialising the LDAP backend.

tardis.settings_changeme.LDAP_TLS

Enable TLS connections.

tardis.settings_changeme.LDAP_URL

Set the URL of the LDAP server, e.g. ldap://localhost:389/

tardis.settings_changeme.LDAP_USER_LOGIN_ATTR

Set the login attribute of the users, usually this will be either cn or uid

tardis.settings_changeme.LDAP_USER_ATTR_MAP

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”}

tardis.settings_changeme.LDAP_GROUP_ID_ATTR

This is where you specify the group identifier from LDAP, usually it will be cn.

tardis.settings_changeme.LDAP_GROUP_ATTR_MAP

This map is used to map internal identifiers like display e.g. {“description”: “display”}

tardis.settings_changeme.LDAP_BASE

Sets the search base of the LDAP queries dc=example, dc=com

tardis.settings_changeme.LDAP_USER_BASE

Sets the search base of user related LDAP queries e.g. “ou=People, ” + LDAP_BASE

tardis.settings_changeme.LDAP_GROUP_BASE

Sets the search base of group related LDAP queries e.g. “ou=Group, ” + LDAP_BASE

LDAPBackend Objects

class tardis.tardis_portal.auth.ldap_auth.LDAPBackend(name, url, base, login_attr, user_base, user_attr_map, group_id_attr, group_base, group_attr_map, admin_user='', admin_pass='')
authenticate(request)
getGroupById(id)

return the group associated with the id:

{"id": 123,

“display”: “Group Name”,}

getGroups(request)

return an iteration of the available groups.

getGroupsForEntity(id)

return a list of groups associated with a particular entity id

getUserById(id)

return the user dictionary in the format of:

{"id": 123,

“display”: “John Smith”, “email”: “john@example.com“}

getUsernameByEmail(email)
get_user(user_id)
searchGroups(**filter)

Table Of Contents

This Page