|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Proxy server authenticationsoftware needs to be able to access the server software regardless of the proxy server configuration of the machine on which the client runs. Using the following code, the client can access the server via any proxy server configuration other than one which requires authentication. IWebProxy iwp20 = WebRequest.DefaultWebProxy; The client needs to be able to handle authenticated proxy servers without prompting the user for login credentials and without any hardcoding of username, password, and domain. I've searched the Internet looking for advice on how to solve this problem. I have tried various suggestions including the following but nothing seems to work. NetworkCredential nc = new NetworkCredential( "username", "password", "domain" ); System.Uri wsUri = new System.Uri( this.Url ); System.Net.WebRequest wr = this.GetWebRequest( wsUri ); wr.Headers.Add( "Keep-Alive:true" ); wr.Proxy.Credentials=nc; Please advise. Thanks Alan Hi Alan,
Have you tried the DefaultCredential property in the CredentialCache object instead of creating a new NetworkCredential object? Raymond Show quoteHide quote "alanw" wrote: > I am developing a C#.NET Windows forms client-server application. The client > software needs to be able to access the server software regardless of the > proxy server configuration of the machine on which the client runs. Using the > following code, the client can access the server via any proxy server > configuration other than one which requires authentication. > > IWebProxy iwp20 = WebRequest.DefaultWebProxy; > > > The client needs to be able to handle authenticated proxy servers without > prompting the user for login credentials and without any hardcoding of > username, password, and domain. I've searched the Internet looking for advice > on how to solve this problem. I have tried various suggestions including the > following but nothing seems to work. > > NetworkCredential nc = new NetworkCredential( "username", "password", > "domain" ); > System.Uri wsUri = new System.Uri( this.Url ); > System.Net.WebRequest wr = this.GetWebRequest( wsUri ); > wr.Headers.Add( "Keep-Alive:true" ); > wr.Proxy.Credentials=nc; > > Please advise. > > Thanks > > Alan > Thanks, Raymond, this works. Alan.
Raymond Yuen wrote: Show quoteHide quote >Hi Alan, > >Have you tried the DefaultCredential property in the CredentialCache object >instead of creating a new NetworkCredential object? > >Raymond > >> I am developing a C#.NET Windows forms client-server application. The client >> software needs to be able to access the server software regardless of the >[quoted text clipped - 22 lines] >> >> Alan -- Message posted via DotNetMonster.com http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-security/200606/1
At What Point Does the Security Begin?
Need advise... [assembly: SecurityPermission] question Help : Access denied ??? Programmatically Install Certificate into Windows Certificate Store Bad Data with DES Decryption Active Directory and ASP.NET 2.0 permission for socket access IDentifiy user acl on a folder ???? https and httplistener |
|||||||||||||||||||||||