<?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: Unable to access item on ArcGIS Online from Sandbox in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-access-item-on-arcgis-online-from/m-p/1041123#M72234</link>
    <description>&lt;P&gt;It sounds like you're&amp;nbsp; trying to access that's on an organizational site on ArcGIS.com (youcompany.maps.arcgis.com) When I have to access items on my organization, I have to use OAuthInfo and IdentityManager to log in.&lt;/P&gt;&lt;P&gt;This is an example of the code I use to get items that aren't public&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    require([
      "esri/Map",
      "esri/views/MapView",
      "esri/layers/FeatureLayer",
      "esri/identity/OAuthInfo",
      "esri/identity/IdentityManager"
    ], function (Map, MapView, FeatureLayer, OAuthInfo, identityManager) {
      let layer, map, view;
      const portalUrl = 'https://yourCompany.maps.arcgis.com';
      const info = new OAuthInfo({
        appId: "xxxxxxxxxxxxxxx", //*** Your Client ID value goes here ***//
        popup: false // inline redirects don't require any additional app configuration
      });
      identityManager.registerOAuthInfos([info]);

      // send users to arcgis.com to login
      identityManager.getCredential(portalUrl);
      identityManager.checkSignInStatus(portalUrl).then(function () {
        layer = new FeatureLayer({
          portalItem: {
            id: "itemID"
          },
          outFields: ["*"]
        });
        map = new Map({
          basemap: 'oceans',
          layers: [layer]
        });
        view = new MapView({
          container: "viewDiv",
          map: map,
          center: [-153, 63],
          zoom: 4,
          popup: {
            autoOpenEnabled: false
          }
        });
      });
    });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Mar 2021 18:04:59 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2021-03-26T18:04:59Z</dc:date>
    <item>
      <title>Unable to access item on ArcGIS Online from Sandbox</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-access-item-on-arcgis-online-from/m-p/1041070#M72229</link>
      <description>&lt;P&gt;I feel like this is a ridiculously noob question, but I'm stuck so here goes...&lt;/P&gt;&lt;P&gt;I'm new to ESRI development and I'm following instructions for the &lt;A href="https://developers.arcgis.com/javascript/latest/display-a-map/" target="_self"&gt;Display a Map tutorial&lt;/A&gt;. However, I'm unexpectedly blocked at the &lt;A href="https://developers.arcgis.com/javascript/latest/display-a-map/#create-a-map" target="_self"&gt;Create a Map&lt;/A&gt; step.&lt;/P&gt;&lt;P&gt;When coding in either CodePen or the ArcGIS sandbox, I get the following logon prompt upon inserting the API: "Please sign in to access the item on ArcGIS Online (item)". When I put in my ArcGIS credentials, I receive an error that "The username or password you entered is incorrect". This is false. I'm currently logged into ArcGIS Online with those same credentials. I am absolutely certain that my ArcGIS logon is correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue I'm having is very similar to &lt;A href="https://community.esri.com/t5/arcgis-api-for-javascript/access-denied-building-web-map/m-p/174295" target="_self"&gt;this one from 2020&lt;/A&gt;, but in my case my work is all hosted online and not run locally. This &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=webmap-basic" target="_self"&gt;ESRI sample from that ticket&lt;/A&gt; works for me, but I'm not sure what that means.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a lot of APIs in my developer dashboard, so perhaps I'm using the wrong one? I've tried inserting the following keys, though my presumption is that the top one is what I want since that's the tutorial I'm working on.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS API for JavaScript&lt;/LI&gt;&lt;LI&gt;ArcGIS Web AppBuilder&lt;/LI&gt;&lt;LI&gt;ArcGIS Experience Builder&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any help or insight is appreciated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 15:09:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-access-item-on-arcgis-online-from/m-p/1041070#M72229</guid>
      <dc:creator>MichaelBessette</dc:creator>
      <dc:date>2021-03-26T15:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to access item on ArcGIS Online from Sandbox</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-access-item-on-arcgis-online-from/m-p/1041123#M72234</link>
      <description>&lt;P&gt;It sounds like you're&amp;nbsp; trying to access that's on an organizational site on ArcGIS.com (youcompany.maps.arcgis.com) When I have to access items on my organization, I have to use OAuthInfo and IdentityManager to log in.&lt;/P&gt;&lt;P&gt;This is an example of the code I use to get items that aren't public&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    require([
      "esri/Map",
      "esri/views/MapView",
      "esri/layers/FeatureLayer",
      "esri/identity/OAuthInfo",
      "esri/identity/IdentityManager"
    ], function (Map, MapView, FeatureLayer, OAuthInfo, identityManager) {
      let layer, map, view;
      const portalUrl = 'https://yourCompany.maps.arcgis.com';
      const info = new OAuthInfo({
        appId: "xxxxxxxxxxxxxxx", //*** Your Client ID value goes here ***//
        popup: false // inline redirects don't require any additional app configuration
      });
      identityManager.registerOAuthInfos([info]);

      // send users to arcgis.com to login
      identityManager.getCredential(portalUrl);
      identityManager.checkSignInStatus(portalUrl).then(function () {
        layer = new FeatureLayer({
          portalItem: {
            id: "itemID"
          },
          outFields: ["*"]
        });
        map = new Map({
          basemap: 'oceans',
          layers: [layer]
        });
        view = new MapView({
          container: "viewDiv",
          map: map,
          center: [-153, 63],
          zoom: 4,
          popup: {
            autoOpenEnabled: false
          }
        });
      });
    });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 18:04:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-access-item-on-arcgis-online-from/m-p/1041123#M72234</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-03-26T18:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to access item on ArcGIS Online from Sandbox</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-access-item-on-arcgis-online-from/m-p/1041620#M72251</link>
      <description>&lt;P&gt;Thank you for your great reply &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, it doesn't help my immediate issue because I'm not creating on a corporate site. I'm accessing ArcGIS on my home computer and via my own personal account, through which I am doing nothing more than following the simple instructions in the 'hello world' demo linked above. Which is why I'm so confused that this isn't working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having said that, I will eventually be developing content on an organizational server, at which time your code may be really useful. So genuinely, thank you.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 17:01:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-access-item-on-arcgis-online-from/m-p/1041620#M72251</guid>
      <dc:creator>MichaelBessette</dc:creator>
      <dc:date>2021-03-29T17:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to access item on ArcGIS Online from Sandbox</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-access-item-on-arcgis-online-from/m-p/1080830#M73950</link>
      <description>&lt;P&gt;Did it work for you? I am also facing similar issue.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 14:03:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-access-item-on-arcgis-online-from/m-p/1080830#M73950</guid>
      <dc:creator>SanthoshkumarRavi</dc:creator>
      <dc:date>2021-07-20T14:03:37Z</dc:date>
    </item>
  </channel>
</rss>

