ICredentialPolicy.ShouldSendCredential Method (Uri, WebRequest, NetworkCredential, IAuthenticationModule)
Assembly: System (in System.dll)
bool ShouldSendCredential( Uri challengeUri, WebRequest request, NetworkCredential credential, IAuthenticationModule authenticationModule )
The Uri that will receive the request. For more information, see the Remarks section.
The NetworkCredential that will be sent with the request if this method returns true.
Return ValueType: System.Boolean
true if the credentials are sent with the request; otherwise, false.
After an ICredentialPolicy policy has been specified by setting the AuthenticationManager.CredentialPolicy property, the IAuthenticationModule that handles authentication for a WebRequest invokes the method before performing the authentication. If this method returns false, authentication is not performed.
When the original request has been redirected or proxy authentication is required, the resource identified by challengeUri can be different from the requested resource that is specified in WebRequest.RequestUri. In the case of redirection, challengeUri contains the actual destination Uri. If proxy authentication is required, challengeUri contains the address of the proxy server that requires client authentication.
Available since 2.0