change the publish function  getTokenUrl  to private function