<?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: Resource proxy Url not pre-pending to request Url (4x) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539759#M50251</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd suggest opening a case with Esri Technical Support so an Analyst can take a closer look.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Oct 2019 21:21:09 GMT</pubDate>
    <dc:creator>BenElan</dc:creator>
    <dc:date>2019-10-02T21:21:09Z</dc:date>
    <item>
      <title>Resource proxy Url not pre-pending to request Url (4x)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539752#M50244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is simple code to add a secure webmap into a MapView. This issue is that the proxy URL in not pre-pending to the Portal item URL. Instead I get the login dialog.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I expect to see a URL like this in my network traffic:&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://pecwquestar.powereng.com/EsriResourceProxy/proxy.ashx?https://pescjsdev.powereng.com/portal/sharing/rest/content/items/4b0a97623245423fb3cbdfb321f0970e" title="https://pecwquestar.powereng.com/EsriResourceProxy/proxy.ashx?https://pescjsdev.powereng.com/portal/sharing/rest/content/items/4b0a97623245423fb3cbdfb321f0970e" rel="nofollow noopener noreferrer" target="_blank"&gt;https://MY_PROXY_URL/EsriResourceProxy/proxy.ashx?https://MY_PORTAL_URL/portal/sharing/rest/content/items/4b0a97623245423fb3cbdfb321f0970e&lt;/A&gt;&amp;nbsp;which successfully returns content in the browser. This indicates that the proxy is properly configured and the values in proxy.config are correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead, I see native URLs like this in my network traffic:&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://pescjsdev.powereng.com/portal/sharing/rest/content/items/4b0a97623245423fb3cbdfb321f0970e?f=pjson" title="https://pescjsdev.powereng.com/portal/sharing/rest/content/items/4b0a97623245423fb3cbdfb321f0970e?f=pjson" rel="nofollow noopener noreferrer" target="_blank"&gt;https://MY_PORTAL_URL/portal/sharing/rest/content/items/4b0a97623245423fb3cbdfb321f0970e&lt;/A&gt;&amp;nbsp;which informs me that I do not have permissions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, my question is: how do I get my JS to format the request Url to be pre-pended with the proxy URL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;script&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;require&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;
 &lt;SPAN class="string token"&gt;"esri/views/MapView"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
 &lt;SPAN class="string token"&gt;"esri/WebMap"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="string token"&gt;"esri/config"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
 &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
 MapView&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
 WebMap&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 esriConfig&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
esriConfig&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;request&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;proxyUrl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"https://MY_PROXY_DOMAIN/EsriResourceProxy/proxy.ashx"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 
 esriConfig&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;portalUrl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"https://MY_PORTAL_DOMAIN/portal"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; webmap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;WebMap&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 portalItem&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 id&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"4b0a97623245423fb3cbdfb321f0970e"&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; view &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;MapView&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 map&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; webmap&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 container&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"viewDiv"&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;script&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:24:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539752#M50244</guid>
      <dc:creator>DirkVandervoort</dc:creator>
      <dc:date>2021-12-11T23:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Resource proxy Url not pre-pending to request Url (4x)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539753#M50245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try adding it as a proxy rule. In the JavaScript app:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;urlUtils&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;addProxyRule&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
   urlPrefix&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"https://MY_PORTAL_DOMAIN/portal"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
   proxyUrl&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"https://MY_PROXY_DOMAIN/EsriResourceProxy/proxy.ashx"&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; ‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In proxy.config:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;serverUrl url&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"https://MY_PORTAL_DOMAIN/portal"&lt;/SPAN&gt;
    username&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"USERNAME"&lt;/SPAN&gt;
    password&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"PASSWORD"&lt;/SPAN&gt;
    matchAll&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"true"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Relevant documentation:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/guide/proxies/" title="https://developers.arcgis.com/javascript/latest/guide/proxies/" rel="nofollow noopener noreferrer" target="_blank"&gt;Setting up proxy overview&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#addProxyRule" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#addProxyRule" rel="nofollow noopener noreferrer" target="_blank"&gt;addProxyRule&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:24:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539753#M50245</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2021-12-11T23:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Resource proxy Url not pre-pending to request Url (4x)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539754#M50246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried that as well without success. No joy...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2019 18:54:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539754#M50246</guid>
      <dc:creator>DirkVandervoort</dc:creator>
      <dc:date>2019-10-02T18:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Resource proxy Url not pre-pending to request Url (4x)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539755#M50247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your browser, when you go to:&lt;/P&gt;&lt;P&gt;&lt;A class="unlinked"&gt;https://MY_PROXY_DOMAIN/EsriResourceProxy/proxy.ashx&lt;/A&gt;?ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should get an output like:&lt;/P&gt;&lt;P&gt;{ "Proxy Version": "1.1.2", "Configuration File": "OK", "Log File": "Not Exist/Readable"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your proxy is set up correctly. Can you check that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2019 18:59:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539755#M50247</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2019-10-02T18:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Resource proxy Url not pre-pending to request Url (4x)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539756#M50248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, pinging the proxy returns the expected results. The proxy is configured correctly. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2019 19:02:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539756#M50248</guid>
      <dc:creator>DirkVandervoort</dc:creator>
      <dc:date>2019-10-02T19:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Resource proxy Url not pre-pending to request Url (4x)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539757#M50249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are there any errors in the console or network traffic in the browser's dev tools?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2019 19:16:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539757#M50249</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2019-10-02T19:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Resource proxy Url not pre-pending to request Url (4x)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539758#M50250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No errors in console or in network traffic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;esriConfig.request.proxyUrl and&amp;nbsp;urlUtils.getProxyUrl() both have values i.e., the proxy URL after the &lt;SPAN&gt;proxyUrl&amp;nbsp;&lt;/SPAN&gt;has been set&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2019 20:59:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539758#M50250</guid>
      <dc:creator>DirkVandervoort</dc:creator>
      <dc:date>2019-10-02T20:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Resource proxy Url not pre-pending to request Url (4x)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539759#M50251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd suggest opening a case with Esri Technical Support so an Analyst can take a closer look.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2019 21:21:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/539759#M50251</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2019-10-02T21:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Resource proxy Url not pre-pending to request Url (4x)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/1131812#M75848</link>
      <description>&lt;P&gt;I had the same issue, in my case, I solved it by using urlUtils.addProxyRule instead of push the rules directly to the esriConfig.requst.proxyRules, this is the way suggested by the API doc&lt;/P&gt;&lt;LI-CODE lang="c"&gt;urlUtils.addProxyRule({
   proxyUrl: "https://localhost:8080/proxy",
   urlPrefix: "https://myportaldomain/arcgis/sharing"
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jan 2022 14:33:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resource-proxy-url-not-pre-pending-to-request-url/m-p/1131812#M75848</guid>
      <dc:creator>JackFanZhang</dc:creator>
      <dc:date>2022-01-08T14:33:14Z</dc:date>
    </item>
  </channel>
</rss>

