<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Invalid tokens on IIS7 in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-tokens-using-client-referer/m-p/146740#M683</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ended up figuring out the issue, and it turned out to be a really silly mistake on my part. When the token was requested it was passed data = {'f': 'json', 'username': 'user', 'password': 'password', 'client': 'referer', 'referer': '&lt;SPAN class="jive-link-external-small"&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmy%2Fapp%2Fdir" rel="nofollow" target="_blank"&gt;http://my/app/dir&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;} so naturally the token is only valid for requests coming from &lt;/SPAN&gt;&lt;SPAN class="jive-link-external-small"&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmy%2Fapp%2Fdir" rel="nofollow" target="_blank"&gt;http://my/app/dir&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;. In my query of a service layer using urllib2, I neglected to &lt;STRONG&gt;call request.add_header('referer, '&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class="jive-link-external-small"&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmy%2Fapp%2Fdir" rel="nofollow" target="_blank"&gt;http://my/app/dir&lt;/A&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;')&lt;/STRONG&gt; before sending the request, so based on the header the request was not coming from &lt;/SPAN&gt;&lt;SPAN class="jive-link-external-small"&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmy%2Fapp%2Fdir" rel="nofollow" target="_blank"&gt;http://my/app/dir&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt; even though that is where my script resides, and as a result I ended up with an invalid token response.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Jul 2016 03:42:20 GMT</pubDate>
    <dc:creator>AnTran</dc:creator>
    <dc:date>2016-07-01T03:42:20Z</dc:date>
    <item>
      <title>Invalid tokens using client: referer</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-tokens-using-client-referer/m-p/146739#M682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a back end python script that is checking out a token. When I am testing on local host am passing in&lt;/P&gt;&lt;P&gt;data = {'f': 'json', 'username': 'user', 'password': 'password', 'client': 'requestip'}&lt;/P&gt;&lt;P&gt;which returns a valid token and I am able to use the token to successfully query the service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, once the app is deployed to production the tokens are no longer valid. I am getting tokens, but when I pass them to my query I am getting a 498 error. I have tried to change the token request to use&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data = {'f': 'json', 'username': 'user', 'password': 'password', 'client': 'referer', 'referer': '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmy%2Fapp%2Fdir" rel="nofollow" target="_blank"&gt;http://my/app/dir&lt;/A&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;on IIS but unfortunately I am still getting tokens that are not accepted for the query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2016 18:28:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-tokens-using-client-referer/m-p/146739#M682</guid>
      <dc:creator>AnTran</dc:creator>
      <dc:date>2016-06-30T18:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid tokens on IIS7</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-tokens-using-client-referer/m-p/146740#M683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ended up figuring out the issue, and it turned out to be a really silly mistake on my part. When the token was requested it was passed data = {'f': 'json', 'username': 'user', 'password': 'password', 'client': 'referer', 'referer': '&lt;SPAN class="jive-link-external-small"&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmy%2Fapp%2Fdir" rel="nofollow" target="_blank"&gt;http://my/app/dir&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;} so naturally the token is only valid for requests coming from &lt;/SPAN&gt;&lt;SPAN class="jive-link-external-small"&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmy%2Fapp%2Fdir" rel="nofollow" target="_blank"&gt;http://my/app/dir&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;. In my query of a service layer using urllib2, I neglected to &lt;STRONG&gt;call request.add_header('referer, '&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class="jive-link-external-small"&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmy%2Fapp%2Fdir" rel="nofollow" target="_blank"&gt;http://my/app/dir&lt;/A&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;')&lt;/STRONG&gt; before sending the request, so based on the header the request was not coming from &lt;/SPAN&gt;&lt;SPAN class="jive-link-external-small"&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmy%2Fapp%2Fdir" rel="nofollow" target="_blank"&gt;http://my/app/dir&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt; even though that is where my script resides, and as a result I ended up with an invalid token response.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2016 03:42:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-tokens-using-client-referer/m-p/146740#M683</guid>
      <dc:creator>AnTran</dc:creator>
      <dc:date>2016-07-01T03:42:20Z</dc:date>
    </item>
  </channel>
</rss>

