__init__(self,
ldap_connection,
base_dn,
returned_id='dn',
start_tls=False,
bind_dn='',
bind_pass='',
**kwargs)
(Constructor)
| source code
|
Create an LDAP authentication plugin.
By passing an existing LDAPObject, you're free to use the LDAP
authentication method you want, the way you want.
This is an *abstract* class, which means it's useless in itself. You
can only use subclasses of this class that implement the _get_dn method (e.g., the
built-in authenticators).
This plugin is compatible with any identifier plugin that defines the
login and password items in the identity
dictionary.
- Parameters:
ldap_connection (ldap.ldapobject.SimpleLDAPObject) - An initialized LDAP connection.
base_dn (unicode) - The base for the Distinguished Name. Something like
ou=employees,dc=example,dc=org, to which will be
prepended the user id:
uid=jsmith,ou=employees,dc=example,dc=org.
returned_id (str, 'dn' or 'login') - Should we return the full DN or just the bare naming identifier
value on successful authentication?
start_tls (bool) - Should we negotiate a TLS upgrade on the connection with the
directory server?
bind_dn (str) - Operate as the bind_dn directory entry
bind_pass (str) - The password for bind_dn directory entry
- Raises:
ValueError - If at least one of the parameters is not defined.
- Overrides:
object.__init__
Attention:
While the DN is always unique, if you configure the authenticator
plugin to return the bare naming attribute, you have to ensure its
uniqueness in the DIT.
|