<?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: How to handle basic Web authentication with esri/request? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278976#M25740</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Oh, sorry I did not understand that the request was not going to ArcGIS Server. In that case you will need to get a proxy that pass basic authentication with your request or use&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jsapi/esri.request-amd.html#esrirequest.setrequestprecallback" title="https://developers.arcgis.com/javascript/3/jsapi/esri.request-amd.html#esrirequest.setrequestprecallback"&gt;esri/request | API Reference | ArcGIS API for JavaScript 3.18 | setRequestPreCallback&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to add your request end point required info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked for something to do this a while back and could not find anything.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Oct 2016 21:06:21 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2016-10-27T21:06:21Z</dc:date>
    <item>
      <title>How to handle basic Web authentication with esri/request?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278973#M25737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to call esri/request on a page that requires username/password, but when I do, I get the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;esri.config.defaults.io.proxyUrl is not set. If making a request to a CORS enabled server, please push the domain into esri.config.defaults.io.corsEnabledServers&lt;BR /&gt;&lt;SPAN&gt;Error: "Unable to load &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2F" rel="nofollow" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;myserver&amp;gt;&amp;nbsp;status: 0"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I do add the domain into corsEnabledServers, I get this error:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;XMLHttpRequest cannot load &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2F" rel="nofollow" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;myserver&amp;gt;. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost" rel="nofollow" target="_blank"&gt;http://localhost&lt;/A&gt;&lt;SPAN&gt;' is therefore not allowed access. The response had HTTP status code 401.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error: Unable to load &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2F" rel="nofollow" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;myserver&amp;gt;' status: 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 20:19:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278973#M25737</guid>
      <dc:creator>BryanChastain</dc:creator>
      <dc:date>2016-10-27T20:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle basic Web authentication with esri/request?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278974#M25738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sure that is when you need to setup a proxy for your app:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://blogs.esri.com/esri/supportcenter/2015/04/07/setting-up-a-proxy/" title="https://blogs.esri.com/esri/supportcenter/2015/04/07/setting-up-a-proxy/"&gt;Setting up a Proxy | Support Services Blog&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will handle the authentication for you and all will be good to go.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 20:45:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278974#M25738</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-10-27T20:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle basic Web authentication with esri/request?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278975#M25739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even if it's not esri authentication? It's just simple web&amp;nbsp;authentication, unrelated to esri's AGS/AGOL stuff. I've used the esri resource proxy before, but only on esri resources...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 20:57:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278975#M25739</guid>
      <dc:creator>BryanChastain</dc:creator>
      <dc:date>2016-10-27T20:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle basic Web authentication with esri/request?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278976#M25740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Oh, sorry I did not understand that the request was not going to ArcGIS Server. In that case you will need to get a proxy that pass basic authentication with your request or use&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jsapi/esri.request-amd.html#esrirequest.setrequestprecallback" title="https://developers.arcgis.com/javascript/3/jsapi/esri.request-amd.html#esrirequest.setrequestprecallback"&gt;esri/request | API Reference | ArcGIS API for JavaScript 3.18 | setRequestPreCallback&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to add your request end point required info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked for something to do this a while back and could not find anything.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 21:06:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278976#M25740</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-10-27T21:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle basic Web authentication with esri/request?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278977#M25741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what I would do&amp;nbsp;in the setRequestPreCallback though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 21:15:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278977#M25741</guid>
      <dc:creator>BryanChastain</dc:creator>
      <dc:date>2016-10-27T21:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle basic Web authentication with esri/request?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278978#M25742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Bryan,&lt;/P&gt;&lt;P&gt;If you want to use setRequestPrecallback function: Please find following samples&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/Esri/developer-support/tree/gh-pages/web-js/Using-setRequestPreCallback-function" title="https://github.com/Esri/developer-support/tree/gh-pages/web-js/Using-setRequestPreCallback-function"&gt;developer-support/web-js/Using-setRequestPreCallback-function at gh-pages · Esri/developer-support · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/Esri/developer-support/tree/gh-pages/web-js/setRequestPreCallback-Modify-Print-Lengend" title="https://github.com/Esri/developer-support/tree/gh-pages/web-js/setRequestPreCallback-Modify-Print-Lengend"&gt;developer-support/web-js/setRequestPreCallback-Modify-Print-Lengend at gh-pages · Esri/developer-support · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This function will intercept any request going out from your application and you can dynamically modify this request to pass what you need to pass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Akshay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 02:01:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278978#M25742</guid>
      <dc:creator>AkshayHarshe</dc:creator>
      <dc:date>2016-11-02T02:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle basic Web authentication with esri/request?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278979#M25743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Akshay. However, I'm still not sure how I would set up the authentication at that point.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 14:22:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278979#M25743</guid>
      <dc:creator>BryanChastain</dc:creator>
      <dc:date>2016-11-02T14:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle basic Web authentication with esri/request?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278980#M25744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure if you have figured this out but you should be able to send username and password before the request is send to the server. But in my opinion that is not the best way to do since your credentials are exposed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2016 18:54:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278980#M25744</guid>
      <dc:creator>AkshayHarshe</dc:creator>
      <dc:date>2016-11-29T18:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle basic Web authentication with esri/request?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278981#M25745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's a branch of ESRI's resource-proxy that supports HTTP Basic Authentication for non-ArcGIS Services:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/sverkerEsriSE/resource-proxy/tree/add-support-for-basic-auth" title="https://github.com/sverkerEsriSE/resource-proxy/tree/add-support-for-basic-auth"&gt;GitHub - sverkerEsriSE/resource-proxy at add-support-for-basic-auth&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to get the .NET version working to connect to Oracle Service Cloud's REST API.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/sverkerEsriSE/resource-proxy/blob/add-support-for-basic-auth/DotNet/README.md" title="https://github.com/sverkerEsriSE/resource-proxy/blob/add-support-for-basic-auth/DotNet/README.md"&gt;resource-proxy/README.md at add-support-for-basic-auth · sverkerEsriSE/resource-proxy · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 22:11:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-handle-basic-web-authentication-with-esri/m-p/278981#M25745</guid>
      <dc:creator>DanMcCoy</dc:creator>
      <dc:date>2016-12-08T22:11:29Z</dc:date>
    </item>
  </channel>
</rss>

