<?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: ArcGIS API 4.0 : Set token for access to Feature Layer from ArcGIS Online in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-api-4-0-set-token-for-access-to-feature/m-p/164772#M15302</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do one of two things to get tokens, which you usually don't need to worry about too many details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just add the IdentityManager and you'll get a dialog to log in.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html"&gt;IdentityManager | API Reference | ArcGIS API for JavaScript 4.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This authentication is only for the current session, refresh the browser and you are asked to log in again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The recommended method is to use OAuth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can look at this sample.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/identity-oauth-basic/" title="https://developers.arcgis.com/javascript/latest/sample-code/identity-oauth-basic/"&gt;Access ArcGIS Online items using OAuthentication | ArcGIS API for JavaScript 4.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Review the source code for this app by using "view source" or developer tools to check the source of this application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The key here is to create an Application in ArcGIS Online, and get an appId/clientId.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me see if I can get the steps down for you here.&lt;/P&gt;&lt;P&gt;Click on "Add Item"&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="214285" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/214285_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="214364" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/214364_pastedImage_3.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to the "Settings" tab for the item.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="214365" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/214365_pastedImage_4.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click on "Update"&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="214366" class="jive-image image-4" src="https://community.esri.com/legacyfs/online/214366_pastedImage_5.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;You'll see your "App ID" in there. I blurred it out, but it's really the client secret you do not want to share. If someone has your client secret, they can eat all your AGOL credits, so do not share it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also like to add "localhost" to the redirct URI. Then when you move this production, add the domain for the server your application will be running from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a link from that JSAPI sample to more docs on OAuth 2.0&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/authentication/index.html" title="https://developers.arcgis.com/authentication/index.html"&gt;ArcGIS Security and Authentication | ArcGIS for Developers&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Aug 2016 16:00:43 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2016-08-03T16:00:43Z</dc:date>
    <item>
      <title>ArcGIS API 4.0 : Set token for access to Feature Layer from ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-api-4-0-set-token-for-access-to-feature/m-p/164771#M15301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to create token for my feature layer from ArcGIS Online. Can anybody help me? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that I may use Identity Manager but never generate token before. Any ideas there are will be helpful!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 11:49:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-api-4-0-set-token-for-access-to-feature/m-p/164771#M15301</guid>
      <dc:creator>VasylynaMykhalchuk</dc:creator>
      <dc:date>2016-08-03T11:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API 4.0 : Set token for access to Feature Layer from ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-api-4-0-set-token-for-access-to-feature/m-p/164772#M15302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do one of two things to get tokens, which you usually don't need to worry about too many details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just add the IdentityManager and you'll get a dialog to log in.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html"&gt;IdentityManager | API Reference | ArcGIS API for JavaScript 4.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This authentication is only for the current session, refresh the browser and you are asked to log in again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The recommended method is to use OAuth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can look at this sample.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/identity-oauth-basic/" title="https://developers.arcgis.com/javascript/latest/sample-code/identity-oauth-basic/"&gt;Access ArcGIS Online items using OAuthentication | ArcGIS API for JavaScript 4.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Review the source code for this app by using "view source" or developer tools to check the source of this application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The key here is to create an Application in ArcGIS Online, and get an appId/clientId.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me see if I can get the steps down for you here.&lt;/P&gt;&lt;P&gt;Click on "Add Item"&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="214285" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/214285_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="214364" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/214364_pastedImage_3.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to the "Settings" tab for the item.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="214365" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/214365_pastedImage_4.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click on "Update"&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="214366" class="jive-image image-4" src="https://community.esri.com/legacyfs/online/214366_pastedImage_5.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;You'll see your "App ID" in there. I blurred it out, but it's really the client secret you do not want to share. If someone has your client secret, they can eat all your AGOL credits, so do not share it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also like to add "localhost" to the redirct URI. Then when you move this production, add the domain for the server your application will be running from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a link from that JSAPI sample to more docs on OAuth 2.0&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/authentication/index.html" title="https://developers.arcgis.com/authentication/index.html"&gt;ArcGIS Security and Authentication | ArcGIS for Developers&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 16:00:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-api-4-0-set-token-for-access-to-feature/m-p/164772#M15302</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2016-08-03T16:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS API 4.0 : Set token for access to Feature Layer from ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-api-4-0-set-token-for-access-to-feature/m-p/164773#M15303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you a lot! You even can't imagine how this advice helpful for me &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/blush.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2016 10:09:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-api-4-0-set-token-for-access-to-feature/m-p/164773#M15303</guid>
      <dc:creator>VasylynaMykhalchuk</dc:creator>
      <dc:date>2016-08-04T10:09:36Z</dc:date>
    </item>
  </channel>
</rss>

