<?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: How to authenticate using only a token or a custom getToken function? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271595#M25023</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need to refresh the token when it expires. You could create a long term token so that the switch happens less frequently.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Sep 2019 17:56:09 GMT</pubDate>
    <dc:creator>BenElan</dc:creator>
    <dc:date>2019-09-20T17:56:09Z</dc:date>
    <item>
      <title>How to authenticate using only a token or a custom getToken function?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271592#M25020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class="" data-value="0"&gt;We're trying to embed a web map from ou ArcGIS Online on our corporate web app.&lt;/DIV&gt;&lt;DIV class="" data-value="0"&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;So we implemented a server-side token generator, since our app users don't have (and shouldn't) a ArcGIS Online account, only the server through a client_id and client_secret.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I couldn't find a way to authenticate through the JS API using only a token or setting a custom &lt;CODE&gt;getToken&lt;/CODE&gt; function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to simply add the token to the layer url, but it opened the login popup :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;const testLayer = new FeatureLayer({   url: "https://services3.arcgis.com/.../ArcGIS/rest/services/.../FeatureServer/0?token=..." });
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally I also want the Javascript to able to access an ArcGIS Online item using only the token, for example a web map JSON.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Using ArcGIS Javascript API 4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:16:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271592#M25020</guid>
      <dc:creator>GeoprocessamentoCarusoJR</dc:creator>
      <dc:date>2021-12-12T16:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate using only a token or a custom getToken function?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271593#M25021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The IdentityManager handles authentication&amp;nbsp;in the JavaScript API.&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken"&gt;You can register a token using this method&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 15:09:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271593#M25021</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2019-09-20T15:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate using only a token or a custom getToken function?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271594#M25022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do I need to automatically refresh it? The token comes from a proxy server. I don't understand how to set a custom refresh token function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 16:51:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271594#M25022</guid>
      <dc:creator>GeoprocessamentoCarusoJR</dc:creator>
      <dc:date>2019-09-20T16:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate using only a token or a custom getToken function?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271595#M25023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need to refresh the token when it expires. You could create a long term token so that the switch happens less frequently.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 17:56:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271595#M25023</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2019-09-20T17:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate using only a token or a custom getToken function?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271596#M25024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes its no problem for me to make a custom refreshToken function, I was just wondering if it the IdentityManager tries to update it automatically? Because that would give an error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 18:05:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271596#M25024</guid>
      <dc:creator>GeoprocessamentoCarusoJR</dc:creator>
      <dc:date>2019-09-20T18:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate using only a token or a custom getToken function?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271597#M25025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/Esri/resource-proxy" title="https://github.com/Esri/resource-proxy"&gt;Have you looked into the Esri resource proxy?&lt;/A&gt;&amp;nbsp;It does all of the authenticating for you, and works for your use case (accessing secured resources without logging in)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 18:13:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271597#M25025</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2019-09-20T18:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate using only a token or a custom getToken function?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271598#M25026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Ben Elan suggested, using the Esri proxy is probably the easiest way to approach this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Sep 2019 13:24:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/271598#M25026</guid>
      <dc:creator>VictorTey</dc:creator>
      <dc:date>2019-09-22T13:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate using only a token or a custom getToken function?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/1134045#M75927</link>
      <description>&lt;P&gt;Is it possible to register multiple tokens by calling&amp;nbsp;&lt;SPAN&gt;registerToken() multiple times with different server urls? Will the IdentityManager then know when service enpoints get which tokens based on server url?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 20:03:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-authenticate-using-only-a-token-or-a-custom/m-p/1134045#M75927</guid>
      <dc:creator>DonnyVelazquez</dc:creator>
      <dc:date>2022-01-14T20:03:11Z</dc:date>
    </item>
  </channel>
</rss>

