code: def update_with(self, name, security_info):
          
          s = self.__app.root.securityDefinitions.get(name, None)
          if s == None:
              raise ValueError('Unknown security name: [{0}]'.format(name))
  
          cred = security_info
          header = True
          if s.type == 'basic':
              cred = 'Basic ' + base64.standard_b64encode(six.b('{0}:{1}'.format(*security_info))).decode('utf-8')
              key = 'Authorization'
          elif s.type == 'apiKey':
              key = s.name
              header = getattr(s, 'in') == 'header'
          elif s.type == 'oauth2':
              key = 'access_token'
          else:
              raise ValueError('Unsupported Authorization type: [{0}, {1}]'.format(name, s.type))
  
          self.__info.update({name: (header, {key: cred})})
docs: insert/clear authorizations
  
          :param str name: name of the security info to be updated
          :param security_info: the real security data, token, ...etc.
          :type security_info: **(username, password)** for *basicAuth*, **token** in str for *oauth2*, *apiKey*.
  
          :raises ValueError: unsupported types of authorizations