<?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 /self Endpoint returns 498 Invalid Token for Valid OAuth Token in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/self-endpoint-returns-498-invalid-token-for-valid/m-p/716207#M66576</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have built a small utility which lives in an Azure function which takes an ArcGIS Online OAuth token as input and calls the &lt;CODE&gt;community/self&lt;/CODE&gt; endpoint to retrieve some basic information about the user. The token is passed to the endpoint from another host which performed&amp;nbsp;a OAuth flow with the use to retrieve the token in the first place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although the token is valid, and is accepted in other requests made from outside Azure, the Azure function is only able to call the self endpoint once, with any valid token, to retrieve the needed user information. For every request after that, whether&amp;nbsp;the token is valid or invalid, or has changed since the last call to the endpoint,&amp;nbsp;being&amp;nbsp;a new token for the same user, or a token for a different user, the endpoint unexpectedly returns a &lt;CODE&gt;403&lt;/CODE&gt; with the standard Invalid Token JSON content.&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;{"error":{"code":498,"message":"Invalid token.","details":[]}}&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I say unexpectedly, because the request is made with &lt;CODE&gt;f=json&amp;nbsp;&lt;/CODE&gt;specified, and the expected result for an Invalid Token would be a &lt;CODE&gt;200&lt;/CODE&gt; result, with the same error in the response body.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Restarting the Azure function, which presumably migrates its host within the Azure cloud, allows for a single call to succeed, before all following calls to the self endpoint fail as described above with a &lt;CODE&gt;403&lt;/CODE&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is my Azure function's host being blacklisted after the first call to the endpoint &lt;STRONG&gt;which succeeds&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;Is this type of operation not supported?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help to resolve this is greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jul 2018 00:12:18 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2018-07-20T00:12:18Z</dc:date>
    <item>
      <title>/self Endpoint returns 498 Invalid Token for Valid OAuth Token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/self-endpoint-returns-498-invalid-token-for-valid/m-p/716207#M66576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have built a small utility which lives in an Azure function which takes an ArcGIS Online OAuth token as input and calls the &lt;CODE&gt;community/self&lt;/CODE&gt; endpoint to retrieve some basic information about the user. The token is passed to the endpoint from another host which performed&amp;nbsp;a OAuth flow with the use to retrieve the token in the first place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although the token is valid, and is accepted in other requests made from outside Azure, the Azure function is only able to call the self endpoint once, with any valid token, to retrieve the needed user information. For every request after that, whether&amp;nbsp;the token is valid or invalid, or has changed since the last call to the endpoint,&amp;nbsp;being&amp;nbsp;a new token for the same user, or a token for a different user, the endpoint unexpectedly returns a &lt;CODE&gt;403&lt;/CODE&gt; with the standard Invalid Token JSON content.&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;{"error":{"code":498,"message":"Invalid token.","details":[]}}&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I say unexpectedly, because the request is made with &lt;CODE&gt;f=json&amp;nbsp;&lt;/CODE&gt;specified, and the expected result for an Invalid Token would be a &lt;CODE&gt;200&lt;/CODE&gt; result, with the same error in the response body.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Restarting the Azure function, which presumably migrates its host within the Azure cloud, allows for a single call to succeed, before all following calls to the self endpoint fail as described above with a &lt;CODE&gt;403&lt;/CODE&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is my Azure function's host being blacklisted after the first call to the endpoint &lt;STRONG&gt;which succeeds&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;Is this type of operation not supported?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help to resolve this is greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2018 00:12:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/self-endpoint-returns-498-invalid-token-for-valid/m-p/716207#M66576</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-07-20T00:12:18Z</dc:date>
    </item>
  </channel>
</rss>

