<?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 Adding a token to a FeatureLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-token-to-a-featurelayer/m-p/1388953#M83804</link>
    <description>&lt;P&gt;I'm trying to migrate from 3.x to 4.x and I have a FeatureLayer that requires an auth token. I used to just pass it in the query string like "&lt;A href="https://blahblah/MapServer/5?token=abc123" target="_blank"&gt;https://blahblah/MapServer/5?token=abc123&lt;/A&gt;" but in 4.x it seems to want the token to be passed in the HTTP header.&lt;/P&gt;&lt;P&gt;The documentation doesn't seem to cover this scenario. The docs simply tell me what header to pass, but since all the HTTP requests are handled by the SDK, I don't know how to configure those requests to have the header. I've tried using the IdentityManager's registerToken() call, and I don't get any errors but it doesn't use the token, either.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Feb 2024 17:28:18 GMT</pubDate>
    <dc:creator>JonathanHilgeman</dc:creator>
    <dc:date>2024-02-29T17:28:18Z</dc:date>
    <item>
      <title>Adding a token to a FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-token-to-a-featurelayer/m-p/1388953#M83804</link>
      <description>&lt;P&gt;I'm trying to migrate from 3.x to 4.x and I have a FeatureLayer that requires an auth token. I used to just pass it in the query string like "&lt;A href="https://blahblah/MapServer/5?token=abc123" target="_blank"&gt;https://blahblah/MapServer/5?token=abc123&lt;/A&gt;" but in 4.x it seems to want the token to be passed in the HTTP header.&lt;/P&gt;&lt;P&gt;The documentation doesn't seem to cover this scenario. The docs simply tell me what header to pass, but since all the HTTP requests are handled by the SDK, I don't know how to configure those requests to have the header. I've tried using the IdentityManager's registerToken() call, and I don't get any errors but it doesn't use the token, either.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:28:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-token-to-a-featurelayer/m-p/1388953#M83804</guid>
      <dc:creator>JonathanHilgeman</dc:creator>
      <dc:date>2024-02-29T17:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a token to a FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-token-to-a-featurelayer/m-p/1388963#M83805</link>
      <description>&lt;P&gt;So it turns out the IdentityManager.registerToken() approach DID work but the client application was using a couple of different subdomains. So I was trying:&lt;/P&gt;&lt;PRE&gt;server: "https://foo.example.com/arcgis/rest/services"&lt;/PRE&gt;&lt;P&gt;...but the the FeatureLayer was on bar.example.com, so the server parameter needed to be:&lt;/P&gt;&lt;PRE&gt;server: "https://bar.example.com/arcgis/rest/services"&lt;/PRE&gt;&lt;P&gt;Because of the mismatch, when I added the FeatureLayer, the IdentityManager couldn't find a token that was valid for that domain.&lt;/P&gt;&lt;P&gt;Once I used the correct subdomain, it worked.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:41:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-token-to-a-featurelayer/m-p/1388963#M83805</guid>
      <dc:creator>JonathanHilgeman</dc:creator>
      <dc:date>2024-02-29T17:41:06Z</dc:date>
    </item>
  </channel>
</rss>

