<?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: Using tokens with secured services in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-tokens-with-secured-services/m-p/445153#M41119</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Todd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the url you've provided for your featurelayer, you've forgot to add the url param-key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt;  heritage &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
          url&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"https://gisserver.domain.com:6443/arcgis/rest/services/ONHI/Heritage_EOs/MapServer/1?token=mnGTVoAhrbV0nEJOuR8G9Ps2noCClcwazQPsJ8spdOIBXpZnSCo_XW7kclwiM47MGfuOj4jvqdv9mGWgmj3snftaQ4sBehRiC2W9AqxrGvyaKECttAbp694lfOtXhi3nshOnoAQpeJCx2LWyJK2g6CfbxHwbZnw6sR3TmR7f0c-C0Ngv9Q0POHrM8ReqyCgb"&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 19:53:46 GMT</pubDate>
    <dc:creator>KoenDemonie</dc:creator>
    <dc:date>2021-12-11T19:53:46Z</dc:date>
    <item>
      <title>Using tokens with secured services</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-tokens-with-secured-services/m-p/445151#M41117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I typically like to include a bit of self-deprecation in my varied GeoNet posts and this will be no different. &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;I have no idea what I am doing&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;Short version: I have several services published to ArcGIS Server. Because these are potentially publicly available to anyone with knowledge of the service URL, I decided to secure certain services. Nonetheless, I want to be able to use these in web maps I am developing with the JS API and do so in a manner in which a user doesn't need to login to view the map.&lt;/P&gt;&lt;P&gt;After doing some reading, I have concluded (perhaps erroneously), that using tokens is the way to go.&lt;/P&gt;&lt;P&gt;In order to do so, I followed the steps at &lt;A href="https://enterprise.arcgis.com/en/server/latest/administer/windows/acquiring-arcgis-tokens.htm"&gt;this useful site&lt;/A&gt;.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I went to &lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="http://gisserver.domain.com:6080/arcgis/tokens"&gt;http://gisserver.domain.com:6080/arcgis/tokens&lt;/A&gt; (obviously, to my server...)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;I entered a user name, password, and selected HTTP Referer&lt;/LI&gt;&lt;LI&gt;For the HTTP Referer, I entered the URL of the page from which the request is being made (the html page with the web map)&lt;/LI&gt;&lt;LI&gt;I set expiration and format&lt;/LI&gt;&lt;LI&gt;I generated the token&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Once generated, I appended the generated token to the URL of the requested service (for example):&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;var&amp;nbsp; heritage = new FeatureLayer({&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; url: "https://&lt;SPAN&gt;&lt;SPAN class=""&gt;gisserver.domain.com&lt;/SPAN&gt;&lt;/SPAN&gt;:6443/arcgis/rest/services/ONHI/Heritage_EOs/MapServer/1?mnGTVoAhrbV0nEJOuR8G9Ps2noCClcwazQPsJ8spdOIBXpZnSCo_XW7kclwiM47MGfuOj4jvqdv9mGWgmj3snftaQ4sBehRiC2W9AqxrGvyaKECttAbp694lfOtXhi3nshOnoAQpeJCx2LWyJK2g6CfbxHwbZnw6sR3TmR7f0c-C0Ngv9Q0POHrM8ReqyCgb"&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;});&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However, when I launch the page, I am still being prompted to enter the user name and password to access the service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, allow me to repeat, &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;I have no idea what I am doing&lt;/STRONG&gt;&lt;/SPAN&gt;. In all likelihood, I have gone about this completely wrong. Maybe there is a better way to do this; maybe I am making a really basic beginners error; maybe both of those are correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regardless, I would like to solve this issue and your help is greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2019 19:46:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-tokens-with-secured-services/m-p/445151#M41117</guid>
      <dc:creator>ToddFagin</dc:creator>
      <dc:date>2019-06-20T19:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using tokens with secured services</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-tokens-with-secured-services/m-p/445152#M41118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Todd,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest that you take a look here:&amp;nbsp;&lt;A class="link-titled" href="https://enterprise.arcgis.com/en/server/latest/administer/windows/accessing-arcgis-token-secured-web-services.htm" title="https://enterprise.arcgis.com/en/server/latest/administer/windows/accessing-arcgis-token-secured-web-services.htm"&gt;Access ArcGIS token-secured web services—ArcGIS Server Administration (Windows) | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2019 20:57:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-tokens-with-secured-services/m-p/445152#M41118</guid>
      <dc:creator>DavidWilson3</dc:creator>
      <dc:date>2019-06-20T20:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using tokens with secured services</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-tokens-with-secured-services/m-p/445153#M41119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Todd,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the url you've provided for your featurelayer, you've forgot to add the url param-key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt;  heritage &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
          url&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"https://gisserver.domain.com:6443/arcgis/rest/services/ONHI/Heritage_EOs/MapServer/1?token=mnGTVoAhrbV0nEJOuR8G9Ps2noCClcwazQPsJ8spdOIBXpZnSCo_XW7kclwiM47MGfuOj4jvqdv9mGWgmj3snftaQ4sBehRiC2W9AqxrGvyaKECttAbp694lfOtXhi3nshOnoAQpeJCx2LWyJK2g6CfbxHwbZnw6sR3TmR7f0c-C0Ngv9Q0POHrM8ReqyCgb"&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:53:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-tokens-with-secured-services/m-p/445153#M41119</guid>
      <dc:creator>KoenDemonie</dc:creator>
      <dc:date>2021-12-11T19:53:46Z</dc:date>
    </item>
  </channel>
</rss>

