Microsoft.Win32.IntranetZoneCredentialPolicy Class

Defines a credential policy to be used for resource requests that are made using System.Net.WebRequest and its derived classes.

See Also: IntranetZoneCredentialPolicy Members

Syntax

public class IntranetZoneCredentialPolicy : System.Net.ICredentialPolicy

Remarks

This policy allows credentials to be sent only if the requested resource is in the same domain as the client that is making the request. For many applications this is the optimal policy because it prevents network credentials from being sent with requests for resources that are not on the intranet.

Note:

System.Net.ICredentialPolicy policies are invoked only if the System.Net.WebRequest or the System.Net.WebProxy that is associated with the request has credentials that are not null. Setting this policy has no effect on requests that do not specify credentials.

Use the System.Net.AuthenticationManager.CredentialPolicy property to set the Microsoft.Win32.IntranetZoneCredentialPolicy policy. The System.Net.IAuthenticationModule that handles authentication for the request will invoke the IntranetZoneCredentialPolicy.ShouldSendCredential(Uri, System.Net.WebRequest, System.Net.NetworkCredential, System.Net.IAuthenticationModule) method before performing the authentication. If the requested resource is in a different domain than the client, the IntranetZoneCredentialPolicy.ShouldSendCredential(Uri, System.Net.WebRequest, System.Net.NetworkCredential, System.Net.IAuthenticationModule) method returns false, and authentication is not performed.

This policy affects all instances of System.Net.WebRequest with non-null credentials in the current application domain. The policy cannot be overridden on individual requests.

Requirements

Namespace: Microsoft.Win32
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0