<?xml version="1.0" encoding="utf-8"?>
<Type Name="ICredentialPolicy" FullName="System.Net.ICredentialPolicy">
  <TypeSignature Language="C#" Value="public interface ICredentialPolicy" />
  <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract ICredentialPolicy" />
  <AssemblyInfo>
    <AssemblyName>System</AssemblyName>
    <AssemblyVersion>2.0.0.0</AssemblyVersion>
    <AssemblyVersion>4.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Interfaces />
  <Docs>
    <since version=".NET 2.0" />
    <remarks>
      <attribution license="cc4" from="Microsoft" modified="false" />
      <para>The credential policy determines whether to send credentials when sending a <see cref="T:System.Net.WebRequest" /> for a network resource, such as the content of a Web page. If credentials are sent, servers that require client authentication can attempt to authenticate the client when the request is received instead of sending a response that indicates that the client's credentials are required. While this saves a round trip to the server, this performance gain must be balanced against the security risk inherent in sending credentials across the network. When the destination server does not require client authentication, it is best not to send credentials.</para>
      <block subset="none" type="note">
        <para>
          <see cref="T:System.Net.ICredentialPolicy" /> policies are invoked only if the <see cref="T:System.Net.WebRequest" /> or the <see cref="T: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.</para>
      </block>
      <para>Use the <see cref="P:System.Net.AuthenticationManager.CredentialPolicy" /> property to set an <see cref="T:System.Net.ICredentialPolicy" /> policy. The <see cref="T:System.Net.IAuthenticationModule" /> that handles authentication for the request will invoke the <see cref="M:System.Net.ICredentialPolicy.ShouldSendCredential(System.Uri,System.Net.WebRequest,System.Net.NetworkCredential,System.Net.IAuthenticationModule)" /> method before performing the authentication. If the method returns false, authentication is not performed.</para>
      <para>An <see cref="T:System.Net.ICredentialPolicy" /> policy affects all instances of <see cref="T:System.Net.WebRequest" /> with non-null credentials in the current application domain. The policy cannot be overridden on individual requests.</para>
    </remarks>
    <summary>
      <attribution license="cc4" from="Microsoft" modified="false" />
      <para>Defines the credential policy to be used for resource requests that are made using <see cref="T:System.Net.WebRequest" /> and its derived classes.</para>
    </summary>
  </Docs>
  <Members>
    <Member MemberName="ShouldSendCredential">
      <MemberSignature Language="C#" Value="public bool ShouldSendCredential (Uri challengeUri, System.Net.WebRequest request, System.Net.NetworkCredential credential, System.Net.IAuthenticationModule authenticationModule);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool ShouldSendCredential(class System.Uri challengeUri, class System.Net.WebRequest request, class System.Net.NetworkCredential credential, class System.Net.IAuthenticationModule authenticationModule) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
        <AssemblyVersion>4.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="challengeUri" Type="System.Uri" />
        <Parameter Name="request" Type="System.Net.WebRequest" />
        <Parameter Name="credential" Type="System.Net.NetworkCredential" />
        <Parameter Name="authenticationModule" Type="System.Net.IAuthenticationModule" />
      </Parameters>
      <Docs>
        <since version=".NET 2.0" />
        <remarks>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>After an <see cref="T:System.Net.ICredentialPolicy" /> policy has been specified by setting the <see cref="P:System.Net.AuthenticationManager.CredentialPolicy" /> property, the <see cref="T:System.Net.IAuthenticationModule" /> that handles authentication for a <see cref="T:System.Net.WebRequest" /> invokes the <see cref="M:System.Net.ICredentialPolicy.ShouldSendCredential(System.Uri,System.Net.WebRequest,System.Net.NetworkCredential,System.Net.IAuthenticationModule)" /> method before performing the authentication. If this method returns false, authentication is not performed.</para>
          <para>When the original request has been redirected or proxy authentication is required, the resource identified by <paramref name="challengeUri" /> can be different from the requested resource that is specified in <see cref="P:System.Net.WebRequest.RequestUri" />. In the case of redirection, <paramref name="challengeUri" /> contains the actual destination <see cref="T:System.Uri" />. If proxy authentication is required, <paramref name="challengeUri" /> contains the address of the proxy server that requires client authentication.</para>
        </remarks>
        <summary>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>Returns a <see cref="T:System.Boolean" /> that indicates whether the client's credentials are sent with a resource request made using an instance of the <see cref="T:System.Net.WebRequest" /> class.</para>
        </summary>
        <returns>
          <attribution license="cc4" from="Microsoft" modified="false" />
          <para>true if the credentials are sent with the request; otherwise, false.</para>
        </returns>
        <param name="challengeUri">
          <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Uri" /> that will receive the request. For more information, see the Remarks section.</param>
        <param name="request">
          <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Net.WebRequest" /> that represents the resource being requested.</param>
        <param name="credential">
          <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Net.NetworkCredential" /> that will be sent with the request if this method returns true. </param>
        <param name="authenticationModule">
          <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Net.IAuthenticationModule" /> that will conduct the authentication, if authentication is required.</param>
      </Docs>
    </Member>
  </Members>
</Type>