Export (0) Print
Expand All

IAuthenticationModule.PreAuthenticate Method

Returns an instance of the Authorization class for an authentication request to a server.

[Visual Basic]
Function PreAuthenticate( _
   ByVal request As WebRequest, _
   ByVal credentials As ICredentials _
) As Authorization
[C#]
Authorization PreAuthenticate(
   WebRequest request,
 ICredentials credentials
);
[C++]
Authorization* PreAuthenticate(
   WebRequest* request,
 ICredentials* credentials
);
[JScript]
function PreAuthenticate(
   request : WebRequest,
 credentials : ICredentials
) : Authorization;

Parameters

request
The WebRequest instance associated with the authentication request.
credentials
The credentials associated with the authentication request.

Return Value

An Authorization instance containing the authorization message for the request.

Remarks

When the CanPreAuthenticate property is true, the PreAuthenticate method will return an instance of the Authorization class containing an authentication message.

Example

[Visual Basic, C#, C++] The following example shows how to use the PreAuthenticate method. For a complete example refer to the AuthenticationManager class.

[Visual Basic] 
' The PreAuthenticate method specifies whether the authentication implemented 
' by this class allows pre-authentication. 
' Even if you do not use it, this method must be implemented to obey to the rules 
' of interface implementation.
' In this case it always returns null. 
Public Function PreAuthenticate(ByVal request As WebRequest, ByVal credentials As ICredentials) As Authorization _
    Implements IAuthenticationModule.PreAuthenticate

  Return Nothing
End Function 'PreAuthenticate


[C#] 
// The PreAuthenticate method specifies whether the authentication implemented 
// by this class allows pre-authentication. 
// Even if you do not use it, this method must be implemented to obey to the rules 
// of interface implementation.
// In this case it always returns null. 
public Authorization PreAuthenticate(WebRequest request, ICredentials credentials) 
{                
  return null;
}

[C++] 
// The PreAuthenticate method specifies if the authentication implemented
// by this class allows pre-authentication.
// Even if you do not use it, this method must be implemented to obey to the rules
// of interface implemebtation.
// In this case it always returns null.
Authorization * PreAuthenticate(WebRequest* request, ICredentials* credentials) {
   return 0;
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

IAuthenticationModule Interface | IAuthenticationModule Members | System.Net Namespace

Show:
© 2014 Microsoft