'Called when the userauth service is started.  Set up instance
variables, check if we should allow password authentication (only
allow if the outgoing connection is encrypted) and set up a login
timeout.'

def serviceStarted(self):

    self.authenticatedWith = []
    self.loginAttempts = 0
    self.user = None
    self.nextService = None
    self.portal = self.transport.factory.portal
    self.supportedAuthentications = []
    for i in self.portal.listCredentialsInterfaces():
        if (i in self.interfaceToMethod):
            self.supportedAuthentications.append(self.interfaceToMethod[i])
    if (not self.transport.isEncrypted('in')):
        if ('password' in self.supportedAuthentications):
            self.supportedAuthentications.remove('password')
    self._cancelLoginTimeout = self.clock.callLater(self.loginTimeout, self.timeoutAuthentication)
