I know it's a couple of years since your question, but did you ever come across a solution for directly encrypting the proxy.config file?
In your work-around with the Web.config, did you need to write additional code in the proxy.ashx to read from web.config?
Define "proxyUser" and "prxyPwd" with the username and password in the appSettings in web.config. Then modify the proxy.ashx file - set usrName=ConfigurationManager.AppSettings["proxyUser"] and usrPwd=ConfigurationManager.AppSettings["proxyPwd"]; Then replace in proxy.ashx wherever there is username and password with the usrName and usrPwd.
Hi Helen, I followed your steps. But after I made the code changes, I started seeing the prompt for the provisional layers.
The Provisional layer is the editable layer. The application will connect through the GIS proxy to get the username and password to go and generate a token for the session and allows the application/editor to make and save changes to the layer.
Instead of making a request with the proxy, the application seemed to be going directly to ArcGIS server and that is when the prompt would appear.
Do you any idea of what causes the login dialog prompt?
Yang, is the feature service published in a standalone ArcGIS server or federated GIS server? If it is in the federated GIS server, you may need to provide more information like tokenServiceUri together with username and password. This is because the token is generated in the Portal for ArcGIS, not the GIS server. You will also be able to debug the application in IDE like Microsoft Visual Studio to find out if the username and password is passed to the proxy.ashx file and why you are still prompted for authentication.
Hi Helen, the feature service is published in our own GIS server, but we do have the tokenServiceUri together with the username and password. We stored the username and password in the proxy.config file. A sample code is shown below:
I notice that the app which uses the GIS proxy can run without the login prompt on my local machine when I debug the code (https://localhost/apps/AppName/ ). But it throws the login prompt when I ran the app on the development version website(https://dev.XXX/apps/AppName ). So I am wondering if you modify any settings in the IIS or other places that I need to do the same to make it work. Thank you.