ldap.sasl
Handling LDAPv3 schema¶
This module implements various authentication methods for SASL bind.
See also
RFC 4422 - Simple Authentication and Security Layer (SASL) RFC 4513 - Lightweight Directory Access Protocol (LDAP): Authentication Methods and Security Mechanisms
Constants¶
-
ldap.sasl.
CB_USER
¶
-
ldap.sasl.
CB_AUTHNAME
¶
-
ldap.sasl.
CB_LANGUAGE
¶
-
ldap.sasl.
CB_PASS
¶
-
ldap.sasl.
CB_ECHOPROMPT
¶
-
ldap.sasl.
CB_NOECHOPROMPT
¶
-
ldap.sasl.
CB_GETREALM
¶
Classes¶
Examples for ldap.sasl¶
This example connects to an OpenLDAP server via LDAP over IPC (see draft-chu-ldap-ldapi) and sends a SASL external bind request.
import ldap, ldap.sasl, urllib
ldapi_path = '/tmp/openldap-socket'
ldap_conn = ldap.initialize(
'ldapi://%s' % (
urllib.quote_plus(ldapi_path)
)
)
# Send SASL bind request for mechanism EXTERNAL
ldap_conn.sasl_non_interactive_bind_s('EXTERNAL')
# Find out the SASL Authorization Identity
print ldap_conn.whoami_s()