<?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 a token to bypass having to sign in to access a hosted feature layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-a-token-to-bypass-having-to-sign-in-to/m-p/1005336#M70932</link>
    <description>&lt;P&gt;Solved, if you're trying to do the same thing, try this, making sure to fill in username and password:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const tokenURL = 
'https://www.arcgis.com/sharing/generateToken?username=&amp;lt;&amp;gt;&amp;amp;password=&amp;lt;&amp;gt;&amp;amp;client=requestip&amp;amp;f=json'
this.http.httpGet(tokenURL).then((res: any) =&amp;gt; {
  identityManager.registerToken({
    server: 'https://www.arcgis.com/sharing/rest',
    token: res.token
  });

  /* Map Init Here */
}).catch((error) =&amp;gt; {
  console.log(error);
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 28 Nov 2020 20:25:58 GMT</pubDate>
    <dc:creator>AndrewMurdoch1</dc:creator>
    <dc:date>2020-11-28T20:25:58Z</dc:date>
    <item>
      <title>Using a token to bypass having to sign in to access a hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-a-token-to-bypass-having-to-sign-in-to/m-p/1005312#M70931</link>
      <description>&lt;P&gt;Good Day&lt;BR /&gt;&lt;BR /&gt;I'm trying to bypass the sign-in process to access our host feature layer from the ArcGIS JavaScript API, I tried implementing OAuth, following the guides, and used this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const info = new OAuthInfo({
    appId: "&amp;lt;blah&amp;gt;",
    popup: false
});

identityManager.registerOAuthInfos([info]);&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;But every time the feature layer load it kicks me over to a sign-in page, and once I sign-in it kicks me back to our application, but to the wrong page and I enter a non-stop loop,. It is possible to use an ApplicationSession and use the Client ID / Client Secret to generate a token, which I can then register to bypass this issue?&lt;BR /&gt;&lt;BR /&gt;We have this function for queries:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;authenticate() {
  this._session = new ApplicationSession({
    clientId: '&amp;lt;blah&amp;gt;',
    clientSecret: '&amp;lt;blah&amp;gt;'
  })
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;But I don't see any option to attach the authentication parameters to the FeatureLayer URL&lt;BR /&gt;&lt;BR /&gt;I looked up this page: &lt;A href="https://enterprise.arcgis.com/en/server/latest/administer/windows/about-arcgis-tokens.htm" target="_blank"&gt;https://enterprise.arcgis.com/en/server/latest/administer/windows/about-arcgis-tokens.htm&lt;/A&gt;&amp;nbsp; which doesn't explain how to attach or generate the token, unless I'm meant to use the token from the ArcGIS Developer Portal.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2020 16:28:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-a-token-to-bypass-having-to-sign-in-to/m-p/1005312#M70931</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2020-11-28T16:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using a token to bypass having to sign in to access a hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-a-token-to-bypass-having-to-sign-in-to/m-p/1005336#M70932</link>
      <description>&lt;P&gt;Solved, if you're trying to do the same thing, try this, making sure to fill in username and password:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const tokenURL = 
'https://www.arcgis.com/sharing/generateToken?username=&amp;lt;&amp;gt;&amp;amp;password=&amp;lt;&amp;gt;&amp;amp;client=requestip&amp;amp;f=json'
this.http.httpGet(tokenURL).then((res: any) =&amp;gt; {
  identityManager.registerToken({
    server: 'https://www.arcgis.com/sharing/rest',
    token: res.token
  });

  /* Map Init Here */
}).catch((error) =&amp;gt; {
  console.log(error);
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2020 20:25:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-a-token-to-bypass-having-to-sign-in-to/m-p/1005336#M70932</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2020-11-28T20:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using a token to bypass having to sign in to access a hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-a-token-to-bypass-having-to-sign-in-to/m-p/1322923#M82088</link>
      <description>&lt;P&gt;I have integrated Portal with ArcGIS Server , so authentication procedure is taken care by the Portal. We use SAML OKTA users inside the portal, Is there a any API Endpoints to generate token for this usecase?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 11:54:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-a-token-to-bypass-having-to-sign-in-to/m-p/1322923#M82088</guid>
      <dc:creator>prudhvi199</dc:creator>
      <dc:date>2023-08-28T11:54:28Z</dc:date>
    </item>
  </channel>
</rss>

