Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

AuthenticationManager.PreAuthenticate Method

Preauthenticates a request.

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

public static Authorization PreAuthenticate (
	WebRequest request,
	ICredentials credentials
)
public static Authorization PreAuthenticate (
	WebRequest request, 
	ICredentials credentials
)
public static function PreAuthenticate (
	request : WebRequest, 
	credentials : ICredentials
) : Authorization
Not applicable.

Parameters

request

A WebRequest to an Internet resource.

credentials

The ICredentials associated with the request.

Return Value

An instance of the Authorization class if the request can be preauthenticated; otherwise, a null reference (Nothing in Visual Basic). If credentials is a null reference (Nothing in Visual Basic), this method returns a null reference (Nothing in Visual Basic).
Exception typeCondition

ArgumentNullException

request is a null reference (Nothing in Visual Basic).

If the authentication module can preauthenticate the request, the PreAuthenticate method returns an Authentication instance and sends the authorization information to the server preemptively instead of waiting for the resource to issue a challenge. This behavior is outlined in section 3.3 of RFC 2617 (HTTP Authentication: Basic and Digest Access Authentication). Authentication modules that support preauthentication allow clients to improve server efficiency by avoiding extra round trips caused by authentication challenges.

Authorization modules that can preauthenticate requests set the IAuthenticationModule.CanPreAuthenticate property to true.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, 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, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.