<?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: Direct pass through ASP.Net proxy page? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59546#M5225</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to go without the proxy, the image export isn't working. I create valid token but I am trying to append it to the "/MapService/export" but I haven't figured out how to do that. I thought I could do it in the esri.setRequestPreCallback() but it never ends up in the "export" request. Can you see something wrong with this code? The variable arcToken is set with the token.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
esri.setRequestPreCallback(function (ioArgs) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (arcToken != '') {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (ioArgs.url.indexOf('?') &amp;gt; -1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var url = ioArgs.url + '&amp;amp;token='+arcToken;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ioArgs.url = url;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (ioArgs.content != {}) { ioArgs.content['token'] = arcToken; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (ioArgs.url.indexOf("GPServer") &amp;gt; -1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ioArgs.preventCache = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } 
&amp;nbsp;&amp;nbsp;&amp;nbsp; return ioArgs;
});
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 22:15:14 GMT</pubDate>
    <dc:creator>DaveHighness</dc:creator>
    <dc:date>2021-12-10T22:15:14Z</dc:date>
    <item>
      <title>Direct pass through ASP.Net proxy page?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59542#M5221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to get my hands on a proxy page that doesn't do the proxy.config token stuff. I want to create my token on the client, append it to any GET or POST requests and then have it go through a proxy page to the ArcGIS Server REST unimpeded and return the response unimpeded. It seems like I should be able to alter the existing ESRI supplied proxy.ashx to make this work but there is a lot of stuff in there that I don't know what it does. Anyone have a creature like I describe and be willing to share?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes I will be doing all this over SSL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 13:34:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59542#M5221</guid>
      <dc:creator>DaveHighness</dc:creator>
      <dc:date>2013-11-21T13:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Direct pass through ASP.Net proxy page?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59543#M5222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;if you want to create your token on the client, what purpose would the proxy serve?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 16:50:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59543#M5222</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2013-11-21T16:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Direct pass through ASP.Net proxy page?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59544#M5223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There are a couple instances where you need a proxy right? One is if you are trying to use a service from another server, cross-domain. The other is if your GET string grows too big for the REST API to parse. Those aren't really an issue for my app right now but they could be in the future.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does the ArcGIS Server JS API convert REST requests to POST if they are longer than a certain size? It seems to me that the requests should always be POST. Is there a way to control if they are GET or POST?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have this thing working without a proxy file now.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 17:59:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59544#M5223</guid>
      <dc:creator>DaveHighness</dc:creator>
      <dc:date>2013-11-21T17:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Direct pass through ASP.Net proxy page?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59545#M5224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;if either the web server hosting a resource on another domain does not support CORS, or the client browser does not support CORS, a proxy will be required to POST information to the second web server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;our ASP.NET and other proxies are a straightforward implementation to channel those requests 'unimpeded'.&amp;nbsp; they include a configuration file so that you can define a whitelist of servers you would actually forward traffic to so that it is more difficult for someone to hijack your proxy and make requests to an unknown server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;our proxy.config also provide the capability to append tokens to requests for secure resources, but if no token information is supplied for a particular resource, the original request is forwarded as is.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 18:31:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59545#M5224</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2013-11-21T18:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Direct pass through ASP.Net proxy page?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59546#M5225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to go without the proxy, the image export isn't working. I create valid token but I am trying to append it to the "/MapService/export" but I haven't figured out how to do that. I thought I could do it in the esri.setRequestPreCallback() but it never ends up in the "export" request. Can you see something wrong with this code? The variable arcToken is set with the token.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
esri.setRequestPreCallback(function (ioArgs) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (arcToken != '') {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (ioArgs.url.indexOf('?') &amp;gt; -1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var url = ioArgs.url + '&amp;amp;token='+arcToken;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ioArgs.url = url;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (ioArgs.content != {}) { ioArgs.content['token'] = arcToken; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (ioArgs.url.indexOf("GPServer") &amp;gt; -1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ioArgs.preventCache = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } 
&amp;nbsp;&amp;nbsp;&amp;nbsp; return ioArgs;
});
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:15:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59546#M5225</guid>
      <dc:creator>DaveHighness</dc:creator>
      <dc:date>2021-12-10T22:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Direct pass through ASP.Net proxy page?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59547#M5226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;are you saying that technique provided by the code you supplied works when a proxy isn't in place?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;why would you ever have to POST your Export Map request?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 20:04:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59547#M5226</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2013-11-21T20:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Direct pass through ASP.Net proxy page?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59548#M5227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, that isn't working. I think I figured out what I need to do, create an authentication token cookie like the one that shows up when you login to an authenticated Map Service from the Rest Services interface. Looks like there are two of them "agstoken" and "AGS_ROLES". I think its the "agstoken" one that I need.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 20:55:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59548#M5227</guid>
      <dc:creator>DaveHighness</dc:creator>
      <dc:date>2013-11-21T20:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Direct pass through ASP.Net proxy page?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59549#M5228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For sure ignore the code I pasted above, that hoses everything up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did figure out a way to get this all working. What I was trying to do was roll my own authenticated service login widget but could never get that working. I created an AGS_ROLES cookie that looks just like the one that the JS API widget produces but I could never get the Dynamic Layer to recognize it and render the layer. I just went with the JS API login widget and that works fine. I didn't realize before that I could grab the token from the Dynamic Layer after it authenticated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for bearing with me.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2013 17:21:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59549#M5228</guid>
      <dc:creator>DaveHighness</dc:creator>
      <dc:date>2013-11-22T17:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Direct pass through ASP.Net proxy page?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59550#M5229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do have this will, POST to ExportMap request because of long layerDefinitions parameter.&lt;/P&gt;&lt;P&gt;I created a thread regarding this issue but I can't find the solution:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/192922"&gt;esri js api post for exportMap&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the proxy does not help or maybe I missed anything ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Apr 2017 18:18:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/direct-pass-through-asp-net-proxy-page/m-p/59550#M5229</guid>
      <dc:creator>NicolasGIS</dc:creator>
      <dc:date>2017-04-23T18:18:38Z</dc:date>
    </item>
  </channel>
</rss>

