docs: def _generateForServerTokenSecurity(self,
                                          serverURL,
                                          token,
                                          tokenUrl,
                                          referer,
                                          expiration=None
                                          ):
          """ generates a token for a feature service """
  
          query_dict = {'serverURL':serverURL,
                        'token': token,
                        'expiration':str(_defaultTokenExpiration),
                        'f': 'json',
                        'request':'getToken',
                        'referer':referer}
          if expiration is not None:
              query_dict['expiration'] = expiration
          secHandler = None
  
          if self.cookiejar is not None:
              secHandler = self
              if secHandler is not None:
                  secHandler._method = "HANDLER"
  
          server_token = self._post(url=tokenUrl,
                                    param_dict=query_dict,
                                    securityHandler=secHandler,
                                    proxy_port=self._proxy_port,
                                    proxy_url=self._proxy_url)
          if self.cookiejar is not None:
              if secHandler is not None:
                  secHandler._method = "TOKEN"
  
          if 'error' in server_token:
              self._server_token = None
              self._server_token_created_on = None
              self._server_token_expires_on = None
              self._server_expires_in = None
  
              return server_token
  
          else:
              self._server_token = server_token['token']
              self._server_token_created_on = datetime.datetime.now()
  
              self._server_token_expires_on = datetime.datetime.fromtimestamp(server_token['expires'] /1000) - \
                  datetime.timedelta(seconds=1)
              self._server_expires_in = (self._server_token_expires_on - self._server_token_created_on).total_seconds()
              return server_token['token']