<?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 Generate a token to query features from a federated arcgis server in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/generate-a-token-to-query-features-from-a/m-p/1146169#M4083</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P class=""&gt;As the name suggests, I have a ArcGIS Server federated to ArcGIS Portal. Portal auth takes over here so I can generate a token with ArcGIS Portal `/sharing/rest/generateToken`. I can then take this token and generate a server URL token - or so the docs would lead me to believe.&lt;/P&gt;&lt;P class=""&gt;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/generate-token.htm" target="_blank" rel="noopener nofollow ugc"&gt;https://developers.arcgis.com/rest/users-groups-and-items/generate-token.htm&lt;/A&gt;&lt;/P&gt;&lt;P class=""&gt;but when I get the "server token" the response from the `/query` endpoint is always invalid token. I'm using `client=requestip` and `serverUrl=&lt;A href="https://...../server/`" target="_blank" rel="noopener nofollow ugc"&gt;https://...../server/`&lt;/A&gt; and `token=&amp;lt;the portal token i got in step 1&amp;gt;`&lt;/P&gt;&lt;P class=""&gt;Has anyone gotten this working?&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;More details:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;step 1 - get a portal token:&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GreggRoemhildt_0-1645470815663.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/34551i22F3F71F0BFB1350/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GreggRoemhildt_0-1645470815663.png" alt="GreggRoemhildt_0-1645470815663.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 2 - pass portal token to get a serverToken:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GreggRoemhildt_1-1645470837765.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/34552i8B4314940246326B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GreggRoemhildt_1-1645470837765.png" alt="GreggRoemhildt_1-1645470837765.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 3: pass server token to the query endpoint&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GreggRoemhildt_2-1645470857184.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/34553iE7910F3C448D6FCB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GreggRoemhildt_2-1645470857184.png" alt="GreggRoemhildt_2-1645470857184.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 21 Feb 2022 19:14:23 GMT</pubDate>
    <dc:creator>roemhildtg</dc:creator>
    <dc:date>2022-02-21T19:14:23Z</dc:date>
    <item>
      <title>Generate a token to query features from a federated arcgis server</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/generate-a-token-to-query-features-from-a/m-p/1146169#M4083</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P class=""&gt;As the name suggests, I have a ArcGIS Server federated to ArcGIS Portal. Portal auth takes over here so I can generate a token with ArcGIS Portal `/sharing/rest/generateToken`. I can then take this token and generate a server URL token - or so the docs would lead me to believe.&lt;/P&gt;&lt;P class=""&gt;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/generate-token.htm" target="_blank" rel="noopener nofollow ugc"&gt;https://developers.arcgis.com/rest/users-groups-and-items/generate-token.htm&lt;/A&gt;&lt;/P&gt;&lt;P class=""&gt;but when I get the "server token" the response from the `/query` endpoint is always invalid token. I'm using `client=requestip` and `serverUrl=&lt;A href="https://...../server/`" target="_blank" rel="noopener nofollow ugc"&gt;https://...../server/`&lt;/A&gt; and `token=&amp;lt;the portal token i got in step 1&amp;gt;`&lt;/P&gt;&lt;P class=""&gt;Has anyone gotten this working?&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;More details:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;step 1 - get a portal token:&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GreggRoemhildt_0-1645470815663.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/34551i22F3F71F0BFB1350/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GreggRoemhildt_0-1645470815663.png" alt="GreggRoemhildt_0-1645470815663.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 2 - pass portal token to get a serverToken:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GreggRoemhildt_1-1645470837765.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/34552i8B4314940246326B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GreggRoemhildt_1-1645470837765.png" alt="GreggRoemhildt_1-1645470837765.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 3: pass server token to the query endpoint&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GreggRoemhildt_2-1645470857184.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/34553iE7910F3C448D6FCB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GreggRoemhildt_2-1645470857184.png" alt="GreggRoemhildt_2-1645470857184.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 Feb 2022 19:14:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/generate-a-token-to-query-features-from-a/m-p/1146169#M4083</guid>
      <dc:creator>roemhildtg</dc:creator>
      <dc:date>2022-02-21T19:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a token to query features from a federated arcgis server</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/generate-a-token-to-query-features-from-a/m-p/1146271#M4084</link>
      <description>&lt;P&gt;Update - I found the issue. Using client:requestip didn't work. No reason as to why - but after changing the client to referer and setting `referer=some-referer` I was able to use the token.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GreggRoemhildt_0-1645477791852.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/34566i05FC342D44900978/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GreggRoemhildt_0-1645477791852.png" alt="GreggRoemhildt_0-1645477791852.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 21:10:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/generate-a-token-to-query-features-from-a/m-p/1146271#M4084</guid>
      <dc:creator>roemhildtg</dc:creator>
      <dc:date>2022-02-21T21:10:13Z</dc:date>
    </item>
  </channel>
</rss>

