def __init__(self, name, username, password, authoritative_source, auth_options=None):
if auth_options is None:<EOL><INDENT>auth_options = {}<EOL><DEDENT>BaseAuth.__init__(self, username, password, authoritative_source, name, auth_options)<EOL>base_auth_backend = '<STR_LIT>' + self.auth_backend<EOL>self._ldap_uri = self._cfg.get(base_auth_backend, '<STR_LIT>')<EOL>self._ldap_basedn = self._cfg.get(base_auth_backend, '<STR_LIT>')<EOL>self._ldap_binddn_fmt = self._cfg.get(base_auth_backend, '<STR_LIT>')<EOL>self._ldap_search = self._cfg.get(base_auth_backend, '<STR_LIT>')<EOL>self._ldap_tls = False<EOL>if self._cfg.has_option(base_auth_backend, '<STR_LIT>'):<EOL><INDENT>self._ldap_tls = self._cfg.getboolean(base_auth_backend, '<STR_LIT>')<EOL><DEDENT>self._ldap_ro_group = None<EOL>self._ldap_rw_group = None<EOL>if self._cfg.has_option(base_auth_backend, '<STR_LIT>'):<EOL><INDENT>self._ldap_ro_group = self._cfg.get(base_auth_backend, '<STR_LIT>')<EOL><DEDENT>if self._cfg.has_option(base_auth_backend, '<STR_LIT>'):<EOL><INDENT>self._ldap_rw_group = self._cfg.get(base_auth_backend, '<STR_LIT>')<EOL><DEDENT>self._logger.debug('<STR_LIT>')<EOL>if not ldap:<EOL><INDENT>self._logger.error('<STR_LIT>')<EOL>raise AuthError('<STR_LIT>')<EOL><DEDENT>self._logger.debug('<STR_LIT>' + self._ldap_uri)<EOL>self._ldap_conn = ldap.initialize(self._ldap_uri)<EOL>if self._cfg.has_option(base_auth_backend, '<STR_LIT>'):<EOL><INDENT>self._ldap_search_binddn = self._cfg.get(base_auth_backend, '<STR_LIT>')<EOL>self._ldap_search_password = self._cfg.get(base_auth_backend, '<STR_LIT>')<EOL>self._ldap_search_conn = ldap.initialize(self._ldap_uri)<EOL><DEDENT>if self._ldap_tls:<EOL><INDENT>try:<EOL><INDENT>self._ldap_conn.start_tls_s()<EOL>if self._ldap_search_conn is not None:<EOL><INDENT>self._ldap_search_conn.start_tls_s()<EOL><DEDENT><DEDENT>except (ldap.CONNECT_ERROR, ldap.SERVER_DOWN) as exc:<EOL><INDENT>self._logger.error('<STR_LIT>')<EOL>self._logger.exception(exc)<EOL>raise AuthError('<STR_LIT>')<EOL><DEDENT><DEDENT>
Constructor.

            Note that the instance variables not are set by the constructor but
            by the :func:`authenticate` method. Therefore, run the
            :func:`authenticate`-method before trying to access those
            variables!

            * `name` [string]
                Name of auth backend.
            * `username` [string]
                Username to authenticate as.
            * `password` [string]
                Password to authenticate with.
            * `authoritative_source` [string]
                Authoritative source of the query.
            * `auth_options` [dict]
                A dict which, if authenticated as a trusted user, can override
                `username` and `authoritative_source`.