<?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 Problem adding a SECURED OGC WMS to map in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-adding-a-secured-ogc-wms-to-map/m-p/1059411#M73183</link>
    <description>&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P data-unlink="true"&gt;we would like to add a secured OGC WMS to a map of the&amp;nbsp;ArcGIS API for JavaScrip.&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;Regarding to "Access secure resources" (&lt;A href="https://developers.arcgis.com/javascript/latest/secure-resources/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/secure-resources/&lt;/A&gt;) it is possible to access a WMS with "Network Credentials".&lt;/P&gt;&lt;P data-unlink="true"&gt;But unfortunately when we add a secured WMS to the map no popup from the browser appears:&lt;/P&gt;&lt;P data-unlink="true"&gt;const layer = new WMSLayer({&lt;BR /&gt;url: url_of_wms,&lt;BR /&gt;sublayers: [&lt;BR /&gt;{&lt;BR /&gt;name: "name_of_layer"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;});&lt;/P&gt;&lt;P data-unlink="true"&gt;const map = new Map({&lt;BR /&gt;basemap: {&lt;BR /&gt;baseLayers: [layer]&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;But when we do a request a pup is showing up (username, password):&lt;/P&gt;&lt;P data-unlink="true"&gt;esriRequest(url_of_wms, {&lt;BR /&gt;withCredentials: true&lt;BR /&gt;}).then(function (response) {&lt;BR /&gt;console.log(response);&lt;BR /&gt;});&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;But I still get an authorization error (401) while adding the WMS to the map, because it doesn't add an authentication header to the request.&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;So, here is our question: How can we add a secured OGC WMS to the map?&lt;/P&gt;&lt;P data-unlink="true"&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 20 May 2021 08:43:46 GMT</pubDate>
    <dc:creator>mattigis</dc:creator>
    <dc:date>2021-05-20T08:43:46Z</dc:date>
    <item>
      <title>Problem adding a SECURED OGC WMS to map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-adding-a-secured-ogc-wms-to-map/m-p/1059411#M73183</link>
      <description>&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P data-unlink="true"&gt;we would like to add a secured OGC WMS to a map of the&amp;nbsp;ArcGIS API for JavaScrip.&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;Regarding to "Access secure resources" (&lt;A href="https://developers.arcgis.com/javascript/latest/secure-resources/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/secure-resources/&lt;/A&gt;) it is possible to access a WMS with "Network Credentials".&lt;/P&gt;&lt;P data-unlink="true"&gt;But unfortunately when we add a secured WMS to the map no popup from the browser appears:&lt;/P&gt;&lt;P data-unlink="true"&gt;const layer = new WMSLayer({&lt;BR /&gt;url: url_of_wms,&lt;BR /&gt;sublayers: [&lt;BR /&gt;{&lt;BR /&gt;name: "name_of_layer"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;});&lt;/P&gt;&lt;P data-unlink="true"&gt;const map = new Map({&lt;BR /&gt;basemap: {&lt;BR /&gt;baseLayers: [layer]&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;But when we do a request a pup is showing up (username, password):&lt;/P&gt;&lt;P data-unlink="true"&gt;esriRequest(url_of_wms, {&lt;BR /&gt;withCredentials: true&lt;BR /&gt;}).then(function (response) {&lt;BR /&gt;console.log(response);&lt;BR /&gt;});&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;But I still get an authorization error (401) while adding the WMS to the map, because it doesn't add an authentication header to the request.&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;So, here is our question: How can we add a secured OGC WMS to the map?&lt;/P&gt;&lt;P data-unlink="true"&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 08:43:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-adding-a-secured-ogc-wms-to-map/m-p/1059411#M73183</guid>
      <dc:creator>mattigis</dc:creator>
      <dc:date>2021-05-20T08:43:46Z</dc:date>
    </item>
  </channel>
</rss>

