def _plain_authentication(self, login, password, authz_id=b""):
        """SASL PLAIN authentication

        :param login: username
        :param password: clear password
        :return: True on success, False otherwise.
        """
        if isinstance(login, six.text_type):
            login = login.encode("utf-8")
        if isinstance(password, six.text_type):
            password = password.encode("utf-8")
        params = base64.b64encode(b'\0'.join([authz_id, login, password]))
        code, data = self.__send_command("AUTHENTICATE", [b"PLAIN", params])
        if code == "OK":
            return True
        return False
def _plain_authentication ( self , login , password , authz_id = b"" ) : if isinstance ( login , six . text_type ) : login = login . encode ( "utf-8" ) if isinstance ( password , six . text_type ) : password = password . encode ( "utf-8" ) params = base64 . b64encode ( b'\0' . join ( [ authz_id , login , password ] ) ) code , data = self . __send_command ( "AUTHENTICATE" , [ b"PLAIN" , params ] ) if code == "OK" : return True return False
SASL PLAIN authentication

        :param login: username
        :param password: clear password
        :return: True on success, False otherwise.