__init__(self,
ldap_connection,
base_dn,
naming_attribute=' uid ' ,
search_scope=' subtree ' ,
restrict='
' ,
**kwargs)
(Constructor)
| source code
|
Create an LDAP authentication plugin determining the DN via LDAP
searches.
By passing an existing LDAPObject, you're free to use the LDAP
authentication method you want, the way you want.
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 .
naming_attribute (unicode ) - The naming attribute for directory entries, uid by
default.
search_scope (str , 'subtree' or 'onelevel', possibly abbreviated
to at least the first three characters) - Scope for ldap searches
restrict (unicode ) - An ldap filter which will be ANDed to the search filter while
searching for entries matching the naming attribute
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 - Should we return full Directory Names or just the bare naming
identifier on successful authentication?
start_tls - Should we negotiate a TLS upgrade on the connection with the
directory server?
bind_dn - Operate as the bind_dn directory entry
bind_pass - The password for bind_dn directory entry
- Raises:
- Overrides:
object.__init__
Attention:
restrict will be interpolated into the search string as a bare
string like in "(&%s(identifier=login))". It must be
correctly parenthesised for such usage as in restrict =
"(objectClass=*)".
|