This documentation is archived and is not being maintained.

ClientWindowsAuthenticationMembershipProvider::ValidateUser Method

Automatically authenticates the current user by using the identity supplied by the operating system.

Namespace:  System.Web.ClientServices.Providers
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

public:
virtual bool ValidateUser(
	String^ username, 
	String^ password
) override

Parameters

username
Type: System::String
Must be Empty or nullptr.
password
Type: System::String
Must be Empty or nullptr.

Return Value

Type: System::Boolean
Always true.

ExceptionCondition
ArgumentException

username is not Empty or nullptr.

-or-

password is not Empty or nullptr.

When you configure your application to use the ClientWindowsAuthenticationMembershipProvider class, the static Membership::ValidateUser method will use this method for its implementation. The ClientWindowsAuthenticationMembershipProvider::ValidateUser method automatically authenticates the current user and sets the static Thread::CurrentPrincipal property to a ClientRolePrincipal object that contains the current WindowsIdentity. If a ClientRoleProvider is configured for your application, you can use the ClientRolePrincipal object to retrieve user role information from the roles service.

The following example code demonstrates how to use this method to authenticate a user by using Windows authentication.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: