<?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: Using DotNet Proxy to Authenticate a Feature Service in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-dotnet-proxy-to-authenticate-a-feature/m-p/1055422#M72976</link>
    <description>&lt;P&gt;I got it....&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;serverUrl url="https://xxxx.xxxx.xxxx.gov/arcgis/rest/services/Test/Test/FeatureServer/0"
matchAll="true" username="User" password="U$er"
tokenServiceUrl="https://xxxx.xxxx.xxxx.gov/arcgis/tokens/" /&amp;gt;&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;urlUtils.addProxyRule({
urlPrefix: "https://xxxx.xxxx.xxxx.gov/arcgis/rest/services/Testing/Test/FeatureServer/0",
proxyUrl: "https://xxxx.xxxx.xxxx.gov/DotNet/proxy.ashx"
});&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt; window.ServiceTest = new FeatureLayer("https://xxxx.xxxx.xxx.gov/arcgis/rest/services/Testing/Test/FeatureServer/0", {
mode: FeatureLayer.MODE_SNAPSHOT,
id: "ServiceTest",
opacity: .4,
visible: true,
outFields:["*"]
});
legendLayers4.push({ layer: ServiceTest, title: 'Test' });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 20:48:32 GMT</pubDate>
    <dc:creator>jaykapalczynski</dc:creator>
    <dc:date>2021-05-06T20:48:32Z</dc:date>
    <item>
      <title>Using DotNet Proxy to Authenticate a Feature Service</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-dotnet-proxy-to-authenticate-a-feature/m-p/1055403#M72972</link>
      <description>&lt;P&gt;I have the DotNet Proxy installed and working for&amp;nbsp; url="&lt;A href="https://route.arcgis.com/&amp;quot;&amp;nbsp;" target="_blank" rel="noopener"&gt;https://route.arcgis.com/"&amp;nbsp;&lt;/A&gt; like in the example.&lt;/P&gt;&lt;P&gt;I am now trying to do this for a Feature Service in my App...but not working it keeps asking me for Credentials...&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;EM&gt;&lt;STRONG&gt;I am not sure if I need to define the URL all the way to the index number or what....&lt;/STRONG&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;EM&gt;Do I need to define the Feature Service in the JS (part 3 below) differently to accept the token?&lt;/EM&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;ANY HELP would be appreciated.&lt;/P&gt;&lt;P&gt;I created a Function that works for the first two and then tried to add my Feature Service&lt;/P&gt;&lt;P&gt;Do I need to define this URL to the index number????&amp;nbsp; &amp;nbsp;/FeatureService/0/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;window.jsWidgets = function(){

//SET UP PROXY RULE FOR ROUTING AND TRAFFIC
// https://community.esri.com/groups/technical-support/blog/2015/04/07/setting-up-a-proxy/

urlUtils.addProxyRule({
   urlPrefix: "route.arcgis.com",
   proxyUrl: "https://xxxx.xxx.xxx.gov/DotNet/proxy.ashx"
});
urlUtils.addProxyRule({
   urlPrefix: "traffic.arcgis.com",
   proxyUrl: "https://xxxx.xxx.xxx.gov/DotNet/proxy.ashx"
});
urlUtils.addProxyRule({
   urlPrefix: "https://xxxx.xxx.xxx.gov/arcgis/rest/services/Something/",
   proxyUrl: "https://xxxx.xxx.xxx.gov/DotNet/proxy.ashx"
});

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then in my proxy.config I added this&lt;/P&gt;&lt;P&gt;DO I need to define this URL to the index number????&amp;nbsp; &amp;nbsp;/FeatureService/0/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;serverUrl url="https://xxxx.xxxx.xxxx.gov/arcgis/rest/services/Something/" 
			matchAll="true" username="User" password="U$er" tokenServiceUrl="https://xxxx.xxxx.xxxx.gov/arcgis/tokens/"/&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I have the Feature Service in my JS&lt;/P&gt;&lt;P&gt;Do I need to reference a Token number or something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;		window.ServiceTest = new FeatureLayer("https://xxxx.xxxx.xxxx.gov/arcgis/rest/services/Something/ServiceName/FeatureServer/0", {
			mode: FeatureLayer.MODE_SNAPSHOT,
			id: "ServiceTest",
			opacity: .4,
			visible: true,
			outFields:["*"]
			});
		legendLayers4.push({ layer: ServiceTest, title: 'NWTL Test' });	&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 20:21:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-dotnet-proxy-to-authenticate-a-feature/m-p/1055403#M72972</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2021-05-06T20:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using DotNet Proxy to Authenticate a Feature Service</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-dotnet-proxy-to-authenticate-a-feature/m-p/1055422#M72976</link>
      <description>&lt;P&gt;I got it....&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;serverUrl url="https://xxxx.xxxx.xxxx.gov/arcgis/rest/services/Test/Test/FeatureServer/0"
matchAll="true" username="User" password="U$er"
tokenServiceUrl="https://xxxx.xxxx.xxxx.gov/arcgis/tokens/" /&amp;gt;&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;urlUtils.addProxyRule({
urlPrefix: "https://xxxx.xxxx.xxxx.gov/arcgis/rest/services/Testing/Test/FeatureServer/0",
proxyUrl: "https://xxxx.xxxx.xxxx.gov/DotNet/proxy.ashx"
});&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt; window.ServiceTest = new FeatureLayer("https://xxxx.xxxx.xxx.gov/arcgis/rest/services/Testing/Test/FeatureServer/0", {
mode: FeatureLayer.MODE_SNAPSHOT,
id: "ServiceTest",
opacity: .4,
visible: true,
outFields:["*"]
});
legendLayers4.push({ layer: ServiceTest, title: 'Test' });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 20:48:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-dotnet-proxy-to-authenticate-a-feature/m-p/1055422#M72976</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2021-05-06T20:48:32Z</dc:date>
    </item>
  </channel>
</rss>

