'(typ, [data]) = authenticate(mechanism, authobject)
Authenticate command - requires response processing.
\'mechanism\' specifies which authentication mechanism is to
be used - it must appear in <instance>.capabilities in the
form AUTH=<mechanism>.
\'authobject\' must be a callable object:
data = authobject(response)
It will be called to process server continuation responses.
It should return data that will be encoded and sent to server.
It should return None if the client abort response \'*\' should
be sent instead.'

def authenticate(self, mechanism, authobject, **kw):

    self.literal = _Authenticator(authobject).process
    try:
        (typ, dat) = self._simple_command('AUTHENTICATE', mechanism.upper())
        if (typ != 'OK'):
            self._deliver_exc(self.error, dat[(-1)], kw)
        self.state = AUTH
        if __debug__:
            self._log(1, 'state    =>    AUTH')
    finally:
        self._release_state_change()
    return self._deliver_dat(typ, dat, kw)
