'Handle an AUTH command.
If the AUTH extension is not supported, send an error response.  If an
authentication mechanism was not specified in the command, send a list
of all supported authentication methods.  Otherwise, send an
authentication challenge to the client and transition to the
AUTH state.
@type args: L{bytes} or L{None}
@param args: The name of an authentication mechanism.'

def do_AUTH(self, args=None):

    if (not getattr(self.factory, 'challengers', None)):
        self.failResponse('AUTH    extension    unsupported')
        return
    if (args is None):
        self.successResponse('Supported    authentication    methods:')
        for a in self.factory.challengers:
            self.sendLine(a.upper())
        self.sendLine('.')
        return
    auth = self.factory.challengers.get(args.strip().upper())
    if ((not self.portal) or (not auth)):
        self.failResponse('Unsupported    SASL    selected')
        return
    self._auth = auth()
    chal = self._auth.getChallenge()
    self.sendLine(('+    ' + base64.encodestring(chal).rstrip('\n')))
    self.state = 'AUTH'
