Export (0) Print
Expand All

ICredentialPolicy.ShouldSendCredential Method

Returns a Boolean that indicates whether the client's credentials are sent with a resource request made using an instance of the WebRequest class.

Namespace: System.Net
Assembly: System (in system.dll)

bool ShouldSendCredential (
	Uri challengeUri,
	WebRequest request,
	NetworkCredential credential,
	IAuthenticationModule authenticationModule
)
boolean ShouldSendCredential (
	Uri challengeUri, 
	WebRequest request, 
	NetworkCredential credential, 
	IAuthenticationModule authenticationModule
)
function ShouldSendCredential (
	challengeUri : Uri, 
	request : WebRequest, 
	credential : NetworkCredential, 
	authenticationModule : IAuthenticationModule
) : boolean
Not applicable.

Parameters

challengeUri

The Uri that will receive the request. For more information, see the Remarks section.

request

The WebRequest that represents the resource being requested.

credential

The NetworkCredential that will be sent with the request if this method returns true.

authenticationModule

The IAuthenticationModule that will conduct the authentication, if authentication is required.

Return Value

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 ShouldSendCredential 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.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft