code: async def on_capability_sasl_enabled(self):
          
          if self.sasl_mechanism:
              if self._sasl_mechanisms and self.sasl_mechanism not in self._sasl_mechanisms:
                  self.logger.warning('Requested SASL mechanism is not in server mechanism list: aborting SASL authentication.')
                  return cap.failed
              mechanisms = [self.sasl_mechanism]
          else:
              mechanisms = self._sasl_mechanisms or ['PLAIN']
  
          if mechanisms == ['EXTERNAL']:
              mechanism = 'EXTERNAL'
          else:
              self._sasl_client = puresasl.client.SASLClient(self.connection.hostname, 'irc',
                  username=self.sasl_username,
                  password=self.sasl_password,
                  identity=self.sasl_identity
              )
  
              try:
                  self._sasl_client.choose_mechanism(mechanisms, allow_anonymous=False)
              except puresasl.SASLError:
                  self.logger.exception('SASL mechanism choice failed: aborting SASL authentication.')
                  return cap.FAILED
              mechanism = self._sasl_client.mechanism.upper()
  
          # Initialize SASL.
          await self._sasl_start(mechanism)
          # Tell caller we need more time, and to not end capability negotiation just yet.
          return cap.NEGOTIATING
docs: Start SASL authentication.