<?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 Access private map in website without login using OAUTH2.0token in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188384#M17460</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i have created various maps and feature layers in arcgis online account all maps are public and i am accessing them...&lt;/P&gt;&lt;P&gt;But now as my website is live, for security reasons, i want to make those layers and map private to my website only but it should not display login window&amp;nbsp;username and pwd for my website, instead i want to pass oauth 2.0 token and&amp;nbsp; then access my private maps..&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example i just use the below map id which is public, but if i want to make it private then how to use it in my website using token generated by oauth&amp;nbsp; from my arcgis app so that it will not ask user name or password for each&amp;nbsp;website user for map page everytime.&lt;/P&gt;&lt;P&gt;Currently i have generated toekns successfully from my arcgis online account.&lt;/P&gt;&lt;P&gt;var webmap = new WebMap({&lt;BR /&gt; portalItem: {&lt;BR /&gt; // autocasts as new PortalItem()&lt;BR /&gt; &lt;STRONG&gt;id: "&amp;lt;?=$map_data_by_country['listing_map_id']?&amp;gt;"&lt;/STRONG&gt;&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Query: how to pass these tokens to access private maps without providing login credentials..&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jun 2020 08:05:20 GMT</pubDate>
    <dc:creator>rsharma</dc:creator>
    <dc:date>2020-06-18T08:05:20Z</dc:date>
    <item>
      <title>Access private map in website without login using OAUTH2.0token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188384#M17460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i have created various maps and feature layers in arcgis online account all maps are public and i am accessing them...&lt;/P&gt;&lt;P&gt;But now as my website is live, for security reasons, i want to make those layers and map private to my website only but it should not display login window&amp;nbsp;username and pwd for my website, instead i want to pass oauth 2.0 token and&amp;nbsp; then access my private maps..&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example i just use the below map id which is public, but if i want to make it private then how to use it in my website using token generated by oauth&amp;nbsp; from my arcgis app so that it will not ask user name or password for each&amp;nbsp;website user for map page everytime.&lt;/P&gt;&lt;P&gt;Currently i have generated toekns successfully from my arcgis online account.&lt;/P&gt;&lt;P&gt;var webmap = new WebMap({&lt;BR /&gt; portalItem: {&lt;BR /&gt; // autocasts as new PortalItem()&lt;BR /&gt; &lt;STRONG&gt;id: "&amp;lt;?=$map_data_by_country['listing_map_id']?&amp;gt;"&lt;/STRONG&gt;&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Query: how to pass these tokens to access private maps without providing login credentials..&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2020 08:05:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188384#M17460</guid>
      <dc:creator>rsharma</dc:creator>
      <dc:date>2020-06-18T08:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Access private map in website without login using OAUTH2.0token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188385#M17461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I had followed this example,&amp;nbsp;&lt;A class="link-titled" href="https://jsbin.com/cebomuzuco/edit?html,output" title="https://jsbin.com/cebomuzuco/edit?html,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&amp;nbsp; and it did worked, but it is hardcoded.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried it in my app through this hardcoded it works . But when i tried this property of webmap using my app token and&amp;nbsp;made my webapp&amp;nbsp;private. this link return the below and when i tried to use in webmap it gives the error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;return JSON:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE style="color: #000000;"&gt;{"operationalLayers":[],"baseMap":{"baseMapLayers":[{"id":"World_Imagery_2017","layerType":"ArcGISTiledMapServiceLayer","url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer","visibility":true,"opacity":1,"title":"World Imagery"},{"id":"VectorTile_7259","type":"VectorTileLayer","layerType":"VectorTileLayer","title":"Hybrid Reference Layer","styleUrl":"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json","isReference":true,"visibility":true,"opacity":1}],"title":"Imagery Hybrid"},"spatialReference":{"wkid":102100,"latestWkid":3857},"authoringApp":"WebMapViewer","authoringAppVersion":"8.1","version":"2.16"}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;CODE::&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;esriRequest("https://www.arcgis.com/sharing/rest/content/items/&lt;STRONG&gt;mywebmapid&lt;/STRONG&gt;/data?f=json&amp;amp;token=&lt;STRONG&gt;mytokengenerated&lt;/STRONG&gt;").then(function(json) {&lt;BR /&gt; console.log(json);&lt;BR /&gt; const webmap = WebMap.fromJSON(json);&lt;/P&gt;&lt;P&gt;const view = new MapView({&lt;BR /&gt; map: webmap,&lt;BR /&gt; container: "viewDiv"&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;dojo.js:253 [esri.WebMap] #load() Failed to load web map d {name: "webmap:invalid-version", message: "Expected major version to be a number, but got ''", details: {…}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried it through other getJSON method and ajax method, it return the same error.&lt;/P&gt;&lt;P&gt;But when i tried to use hardcode return JSON directly to access my webmap, it works.. like below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var webmapJSON={"operationalLayers":[],"baseMap":{"baseMapLayers":[{"id":"World_Hillshade_895","layerType":"ArcGISTiledMapServiceLayer","url":"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer","visibility":true,"opacity":1,"title":"World Hillshade"},{"id":"VectorTile_6451","type":"VectorTileLayer","layerType":"VectorTileLayer","title":"World Topographic Map","styleUrl":"https://cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json","visibility":true,"opacity":1},{"id":"geotiffs_6320","layerType":"ArcGISMapServiceLayer","url":"https://services.arcgisonline.co.nz/arcgis/rest/services/LINZ/geotiffs/MapServer","visibility":true,"opacity":1,"title":"NZ - LINZ Topographic","itemId":"126df938335049028779fbab6d298daf","showLegend":true}],"title":"Topographic"},"spatialReference":{"wkid":102100,"latestWkid":3857},"authoringApp":"WebMapViewer","authoringAppVersion":"8.1","version":"2.16"};&lt;BR /&gt;var webmap = WebMap.fromJSON(webmapJSON);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand where is the problem, i think they are not accessing my webmap but when i used this return hardcode, my app access these globallly used maps..??&lt;/P&gt;&lt;P&gt;also tried through this code..returns same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jQuery.ajax({&lt;BR /&gt; type : "GET",&lt;BR /&gt; async: false, &lt;BR /&gt; url : "https://www.arcgis.com/sharing/content/items/&lt;STRONG&gt;mywebmapid&lt;/STRONG&gt;/data?f=json&amp;amp;token=&lt;STRONG&gt;mytokengenerated&lt;/STRONG&gt;",&lt;BR /&gt; success: function(webmapJSON) {&lt;BR /&gt; &lt;BR /&gt; webmap = WebMap.fromJSON(webmapJSON);&lt;BR /&gt; console.log(webmap);&lt;BR /&gt; //webJson=response;&lt;BR /&gt; }//End Success&lt;BR /&gt; });//End Ajax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciable..&lt;/P&gt;&lt;P&gt;Thanks in advance...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jun 2020 07:13:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188385#M17461</guid>
      <dc:creator>rsharma</dc:creator>
      <dc:date>2020-06-20T07:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Access private map in website without login using OAUTH2.0token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188386#M17462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;the above code is correct just need to&amp;nbsp;&lt;STRONG&gt;parse json string.&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;jQuery.ajax({&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;type : "GET",&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;async: false,&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; padding: 0px;"&gt;url : "&lt;/SPAN&gt;&lt;A href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwww.arcgis.com%2Fsharing%2Fcontent%2Fitems%2F" rel="nofollow" style="color: #287433; background-color: #ffffff; border: 0px; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;https://www.arcgis.com/sharing/content/items/&lt;/A&gt;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold; padding: 0px;"&gt;mywebmapid&lt;/STRONG&gt;&lt;SPAN style="background-color: #ffffff;"&gt;/data?f=json&amp;amp;token=&lt;/SPAN&gt;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold; padding: 0px;"&gt;mytokengenerated&lt;/STRONG&gt;&lt;SPAN style="background-color: #ffffff;"&gt;",&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;success: function(webmapJSON) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;//parse json string here&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;webmap = WebMap.fromJSON(webmapJSON);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;//webJson=response;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;}//End Success&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;});//End Ajax&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2020 08:28:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188386#M17462</guid>
      <dc:creator>rsharma</dc:creator>
      <dc:date>2020-06-22T08:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Access private map in website without login using OAUTH2.0token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188387#M17463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But i need to find out how to toggle basmap through this method, till now i&amp;nbsp;was using ids, now i am directly using json through restapi to create webmap. Earlier i was toggling like this, any function would be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let LINZ_Topographic_Eagle_NZ = new Basemap({portalItem: {id: "&amp;lt;?=$esri_map_id_nz_topo?&amp;gt;"}}); //NZ - LINZ Topographic&lt;/P&gt;&lt;P&gt;function setbasemap(basemap){&lt;/P&gt;&lt;P&gt;webmap.basemap = basemap;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;// Click event on Topo Button&lt;BR /&gt; topoBtn.addEventListener('click', function(){&lt;/P&gt;&lt;P&gt;setbasemap(LINZ_Topographic_Eagle_NZ);&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;//Click event on Satellite button&lt;BR /&gt; satelliteBtn.addEventListener('click', function(){&lt;BR /&gt;setbasemap('satellite');&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2020 08:32:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188387#M17463</guid>
      <dc:creator>rsharma</dc:creator>
      <dc:date>2020-06-22T08:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Access private map in website without login using OAUTH2.0token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188388#M17464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed your example, but my webmap still prompts to login.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I receive the JSON properly, with the generated token, but then it pops up and asks me to login.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How are you doing the authentication?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that the generated token is only allowing the JSON to be received, it is not also allowing the map to be viewed with that received JSON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you send the authentication to the webmap?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 04:36:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188388#M17464</guid>
      <dc:creator>JoshFields</dc:creator>
      <dc:date>2020-07-02T04:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Access private map in website without login using OAUTH2.0token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188389#M17465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes it may happen sometime you can use through identity manager&lt;/P&gt;&lt;P&gt;token = {&lt;BR /&gt; 'server': settings.countryLayerUrl,&lt;BR /&gt; 'token': settings.gettoken,//&amp;nbsp;put your token here&lt;BR /&gt; };&lt;BR /&gt; IdentityManager.registerToken(token);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2020 10:25:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-private-map-in-website-without-login-using/m-p/188389#M17465</guid>
      <dc:creator>rsharma</dc:creator>
      <dc:date>2020-07-03T10:25:33Z</dc:date>
    </item>
  </channel>
</rss>

