def _authenticate_user_dn(self, password):
        """
        Binds to the LDAP server with the user's DN and password. Raises
        AuthenticationFailed on failure.
        """
        if self.dn is None:
            raise self.AuthenticationFailed("failed to map the username to a DN.")

        try:
            sticky = self.settings.BIND_AS_AUTHENTICATING_USER

            self._bind_as(self.dn, password, sticky=sticky)
        except ldap.INVALID_CREDENTIALS:
            raise self.AuthenticationFailed("user DN/password rejected by LDAP server.")
def _authenticate_user_dn ( self , password ) : if self . dn is None : raise self . AuthenticationFailed ( "failed to map the username to a DN." ) try : sticky = self . settings . BIND_AS_AUTHENTICATING_USER self . _bind_as ( self . dn , password , sticky = sticky ) except ldap . INVALID_CREDENTIALS : raise self . AuthenticationFailed ( "user DN/password rejected by LDAP server." )
Binds to the LDAP server with the user's DN and password. Raises
        AuthenticationFailed on failure.