'Binds to the LDAP server with the user\'s DN and password. Raises
AuthenticationFailed on failure.'

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.')
