Skip to content

Use user-provided credentials to bind to LDAP server #57

@TuringTux

Description

@TuringTux

Currently, the Taiga plugin either uses a dedicated LDAP bind user, or anonymous bind to browse the LDAP server to find the account of the user who tried to login, verify their credentials and return the result.

Many LDAP servers are configured so that the user's credentials can also be used as LDAP bind user (normally giving only a very limited view of only the user's LDAP entry). It would be nice if the plugin could work with that.

Idea for the configuration

INSTALLED_APPS += ["taiga_contrib_ldap_auth_ext"]

# Multiple LDAP servers are currently not supported, see
# https://github.com/Monogramm/taiga-contrib-ldap-auth-ext/issues/16
LDAP_SERVER = "ldaps://ldap.example.com"
LDAP_PORT = 636

LDAP_BIND_DN = "CN=<username>,OU=DevTeam,DC=example,DC=com"
LDAP_BIND_WITH_USER_PROVIDED_CREDENTIALS = True

LDAP_SEARCH_BASE = 'OU=DevTeam,DC=example,DC=net'

LDAP_USERNAME_ATTRIBUTE = "uid"
LDAP_EMAIL_ATTRIBUTE = "mail"
LDAP_FULL_NAME_ATTRIBUTE = "givenName"

LDAP_SAVE_LOGIN_PASSWORD = False

LDAP_MAP_USERNAME_TO_UID = None

The idea would be to set LDAP_BIND_WITH_USER_CREDENTIALS = True to indicate the logging in user's credentials should be used to bind (meaning also that login is considered successful if binding works; which is a difference from how it would otherwise work), and LDAP_BIND_DN = "CN=<username>,OU=DevTeam,DC=example,DC=com" containing a placeholder.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions