code: def securityHandler(self, value):
          
          if isinstance(value, BaseSecurityHandler):
              if isinstance(value, (AGSTokenSecurityHandler,
                                    PortalServerSecurityHandler)):
                  self._securityHandler = value
              else:
                  pass
          elif value is None:
              self._securityHandler = None
docs: sets the security handler