I started working on a project where I need to read and parse an xml file from  a url. This url needs a credentials to successfully read the data from it, so I'm thinking while reading the file there will be a modal window that will accept a username and password to authenticate the source. This url is from the outside source and needed a credential to authenticate the connection for us to successfully connect and read the xml file. Also this is only available privately on request.My concern is how could I prevent a user to see the credential being passed in the modal form then processed it in the background? It's like instead of getting the actual password I'm thinking like hash it? But by doing that the authentication would fail? Any suggestion if there is a better approach for this?
Secure way in authenticating credentials when Reading an xml file from the outside source
c#;xml;asp.net mvc 4
if you are open to a different option: you could try having a response/request pattern, where you[the request] calls a service[the response] and pass a network credential object [built into .net] then upon successful authentication pass back the xml though the service callpublic XElement GetXml(IProviderInformation input){    using (var svc = new Service())    {        svc.PreAuthenticate = true;        svc.UseDefaultCredentials = false;        svc.Credentials = new NetworkCredential        {            UserName = input.ProviderAccountInfo.AccountUserName,            Password = input.ProviderAccountInfo.AccountPassword        };        var rslt = svc.GetXmlFromService();        var result = XElement.Parse(rslt);        return result;    }}