<?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: Can the url of the layer be different from the server address in IdentityManager.registerToken? Token required in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-url-of-the-layer-be-different-from-the/m-p/1246625#M79827</link>
    <description>&lt;P&gt;As far as I know, the short answer is no, since IdentityManager has no means of knowing when different host names refer to the same host.&amp;nbsp; However, the workaround is otherwise simple.&amp;nbsp; If you intend to use multiple host names that refer to the same host, you can simply call registerToken for each host name with the same token:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;IdentityManager.registerToken({server:"https://server1/server/rest/services", token:tokenValue});
IdentityManager.registerToken({server:"https://server2/server/rest/services", token:tokenValue});
IdentityManager.registerToken({server:"https://192.168.1.2/server/rest/services", token:tokenValue});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jan 2023 21:42:38 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2023-01-09T21:42:38Z</dc:date>
    <item>
      <title>Can the url of the layer be different from the server address in IdentityManager.registerToken? Token required</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-url-of-the-layer-be-different-from-the/m-p/1246401#M79818</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;var serverInfo = new ServerInfo();&lt;BR /&gt;serverInfo.server = "&lt;A href="https://wl.arcgisonline.cn/server/rest/services" target="_blank" rel="noopener"&gt;https://wl.arcgisonline.cn/server/rest/services&lt;/A&gt;";&lt;BR /&gt;serverInfo.tokenServiceUrl = "&lt;A href="https://wl.arcgisonline.cn/portal/sharing/rest/generateToken" target="_blank" rel="noopener"&gt;https://wl.arcgisonline.cn/portal/sharing/rest/generateToken&lt;/A&gt;";&lt;BR /&gt;var userInfo = {username:"***",password:"***"};&amp;nbsp;&lt;/P&gt;&lt;P&gt;IdentityManager.generateToken(serverInfo,userInfo).then(function(data){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; var tokenValue = data.token;&amp;nbsp; IdentityManager.registerToken({server:"&lt;A href="https://wl.arcgisonline.cn/server/rest/services" target="_blank" rel="noopener"&gt;https://wl.arcgisonline.cn/server/rest/services&lt;/A&gt;",token:tokenValue});&lt;BR /&gt;},function(error){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; console.error(error);&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; layer &lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;new&lt;/SPAN&gt; &lt;SPAN class=""&gt;MapImageLayer&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;url&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;"&lt;A href="https://wl.arcgisonline.cn/server/rest/services/wl/time1/MapServer" target="_blank" rel="noopener"&gt;https://wl.arcgisonline.cn/server/rest/services/wl/time1/MapServer&lt;/A&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;map.add(layer);&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The token used to access SceneLayer comes from IdentityManager.registerToken.&lt;/P&gt;&lt;P&gt;My question is, when accessing the SceneLayer data, must the url be consistent with the server in IdentityManager.registerToken? Can I use the following methods (must bring the token)&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; layer &lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;new&lt;/SPAN&gt; &lt;SPAN class=""&gt;MapImageLayer&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;url&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;"&lt;A href="https://172.16.8.11:8080/server/rest/services/wl/time1/MapServer" target="_blank" rel="noopener"&gt;https://172.16.8.11:8080/server/rest/services/wl/time1/MapServer&lt;/A&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN class=""&gt;Can the url of the layer be different from the server address in IdentityManager.registerToken? Token required&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 12:39:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-url-of-the-layer-be-different-from-the/m-p/1246401#M79818</guid>
      <dc:creator>rendtime</dc:creator>
      <dc:date>2023-01-09T12:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can the url of the layer be different from the server address in IdentityManager.registerToken? Token required</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-url-of-the-layer-be-different-from-the/m-p/1246625#M79827</link>
      <description>&lt;P&gt;As far as I know, the short answer is no, since IdentityManager has no means of knowing when different host names refer to the same host.&amp;nbsp; However, the workaround is otherwise simple.&amp;nbsp; If you intend to use multiple host names that refer to the same host, you can simply call registerToken for each host name with the same token:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;IdentityManager.registerToken({server:"https://server1/server/rest/services", token:tokenValue});
IdentityManager.registerToken({server:"https://server2/server/rest/services", token:tokenValue});
IdentityManager.registerToken({server:"https://192.168.1.2/server/rest/services", token:tokenValue});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 21:42:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-url-of-the-layer-be-different-from-the/m-p/1246625#M79827</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-01-09T21:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can the url of the layer be different from the server address in IdentityManager.registerToken? Token required</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-url-of-the-layer-be-different-from-the/m-p/1247125#M79841</link>
      <description>&lt;P&gt;that seems to be the only way, thank you&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 02:50:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-the-url-of-the-layer-be-different-from-the/m-p/1247125#M79841</guid>
      <dc:creator>rendtime</dc:creator>
      <dc:date>2023-01-11T02:50:55Z</dc:date>
    </item>
  </channel>
</rss>

