.net core alternative for handling proxy requests

803
1
02-23-2023 01:12 AM
YashvitNaik
New Contributor III

I'm migrating a  web application which was designed in the .net framework GIS to .net core. and currently am on ArcGIS Javascript API 4.23.

In the .net framework application, I'm using the proxy.ashx (https://github.com/Esri/resource-proxy/tree/master/DotNet), to handle the proxy requests but this proxy handler is not compatible with .net core.

I tried https://www.nuget.org/packages/EsriArcgis.Proxy.Core but it doesn't support token authentication. I have to predefine the authentication config in the proxy.config.json file but that is not possible with our application.

Is there a solution for getting around this, I need to use a proxy as am not certain if the servers I am accessing will be CORS enabled.

0 Kudos
1 Reply
LaurenBoyd
Esri Contributor

Hi @YashvitNaik 

Esri does not provide a proxy to bypass CORS and it's not recommended to use the Esri resource proxy on Github since it's no longer maintained. In the best practices, it's noted to:

If a proxy is absolutely needed to get around CORS issues, you will need to create or find a third party proxy that you can use with your application and configure it as outlined here: https://developers.arcgis.com/javascript/latest/proxies/ 

Lauren
0 Kudos