code: def __getRefererUrl(self, url=None):
          
          if url is None:
              url = "http://www.arcgis.com/sharing/rest/portals/self"
          params = {
              "f" : "json",
              "token" : self.token
          }
          val = self._get(url=url, param_dict=params,
                             proxy_url=self._proxy_url,
                             proxy_port=self._proxy_port)
          self._referer_url = "arcgis.com"#"http://%s.%s" % (val['urlKey'], val['customBaseUrl'])
          self._token = None
          return self._referer_url
docs: gets the referer url for the token handler