code: async def on_capability_sasl_available(self, value):
          
          if value:
              self._sasl_mechanisms = value.upper().split(',')
          else:
              self._sasl_mechanisms = None
  
          if self.sasl_mechanism == 'EXTERNAL' or (self.sasl_username and self.sasl_password):
              if self.sasl_mechanism == 'EXTERNAL' or puresasl:
                  return True
              self.logger.warning('SASL credentials set but puresasl module not found: not initiating SASL authentication.')
          return False
docs: Check whether or not SASL is available.