<?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: Access secure resources from ArcGIS Portal with ArcGIS API for javascript without login pop-up window in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-secure-resources-from-arcgis-portal-with/m-p/218529#M20288</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a sample code that could be useful:&amp;nbsp;&lt;A class="link-titled" href="https://github.com/vcoelho/ArcGISSamples/blob/master/identityManagerBase.html" title="https://github.com/vcoelho/ArcGISSamples/blob/master/identityManagerBase.html"&gt;ArcGISSamples/identityManagerBase.html at master · vcoelho/ArcGISSamples · GitHub&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Apr 2020 22:17:15 GMT</pubDate>
    <dc:creator>VictorCoelho</dc:creator>
    <dc:date>2020-04-12T22:17:15Z</dc:date>
    <item>
      <title>Access secure resources from ArcGIS Portal with ArcGIS API for javascript without login pop-up window</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-secure-resources-from-arcgis-portal-with/m-p/218528#M20287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have recently started working on ArcGIS API's. I am able to add feature layers/ edit layers etc. However I want to validate user id and password using ArcGIS API's and generate token once the credentials are verified.&lt;BR /&gt;I tried couple of ways as below but could not accomplish the results.&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;function login(user, password)&lt;BR /&gt; {&lt;BR /&gt; var serverInfo = new ServerInfo();&lt;BR /&gt;serverInfo.server = 'https://myorganizatoon.arcgis.com/';&lt;BR /&gt;serverInfo.tokenServiceUrl="http://myorganization.arcgis.com/arcgis/tokens/generateToken";&lt;BR /&gt;//serverInfo.tokenServiceUrl=http://www.arcgis.com/arcgis/tokens/generateToken";&lt;BR /&gt;//(I don't know which of these two links are correct for the serverinfo, that's why I tried both. Please suggest me which one is correct?)&lt;BR /&gt; esriId.registerServers([serverInfo]);&lt;BR /&gt; var serverInfo = esriId.serverInfos[0];&lt;/P&gt;&lt;P&gt;var userInfo = {};&lt;BR /&gt; userInfo.username = "myusername";&lt;BR /&gt; userInfo.password = "mypassword";&lt;BR /&gt; esriId.generateToken(serverInfo, userInfo).then(function (response)&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp;response.server = serverInfo.server;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;response.userId = user;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;esriId.registerToken(response);&lt;BR /&gt; });&lt;BR /&gt; }&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;I am using ArcGIS API for javascript 3.31.&lt;BR /&gt;Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2020 08:42:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-secure-resources-from-arcgis-portal-with/m-p/218528#M20287</guid>
      <dc:creator>ShubhamTiwari</dc:creator>
      <dc:date>2020-04-07T08:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Access secure resources from ArcGIS Portal with ArcGIS API for javascript without login pop-up window</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-secure-resources-from-arcgis-portal-with/m-p/218529#M20288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a sample code that could be useful:&amp;nbsp;&lt;A class="link-titled" href="https://github.com/vcoelho/ArcGISSamples/blob/master/identityManagerBase.html" title="https://github.com/vcoelho/ArcGISSamples/blob/master/identityManagerBase.html"&gt;ArcGISSamples/identityManagerBase.html at master · vcoelho/ArcGISSamples · GitHub&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Apr 2020 22:17:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-secure-resources-from-arcgis-portal-with/m-p/218529#M20288</guid>
      <dc:creator>VictorCoelho</dc:creator>
      <dc:date>2020-04-12T22:17:15Z</dc:date>
    </item>
  </channel>
</rss>

