1
I have an ASP.NET application that accesses a remote server (outside the company domain; external URL) to verify some data. When I run the application on development environment - localhost accessing external URL, I take 407 error. That same code when published to the homologation server, that doesn’t happen. My problem is finding a way to identify the user credentials on the localhost. I am using the following code to check the proxy:
var oHand = new HttpClientHandler();
if (WebRequest.DefaultWebProxy.GetProxy(new Uri(pURL)) != null)
{
oHand.Proxy = WebRequest.DefaultWebProxy;
oHand.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;
}
The only way I could make it work was by putting user data (network login and password) on web.config, which complicates version control, as it can put the network password of someone on the team exposed by accident. Someone would have a suggestion?
@fabioln , thank you for your contribution. However, I’ve tried that too. In development, with this config, does not find the credentials of the user, I imagine for not running directly on the machine and yes on IIS. In a Windows app that I have, works normally. But in Desenv does not scroll...
– Anderson Oliveira