AuthenticationService::ValidateUser Method
Authenticates user credentials without issuing an authentication ticket.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
[OperationContractAttribute] public: bool ValidateUser( String^ username, String^ password, String^ customCredential )
Parameters
- username
- Type: System::String
The user name to be validated.
- password
- Type: System::String
The password for the specified user.
- customCredential
- Type: System::String
The value or values to validate in addition to userName and password, if any.
| Exception | Condition |
|---|---|
| ArgumentNullException | userName or password is nullptr. |
The ValidateUser method authenticates the user credentials but does not set an authentication cookie. Without an authentication cookie, the user will not be logged in even if the credentials are valid.
Use the ValidateUser method when you must check whether a user's credentials are valid without receiving an authentication cookie. For example, you might do this if the authentication cookie is already stored in a client application but you want to verify that the user's credentials are still valid when a new session starts.
The ValidateUser method raises the Authenticating event, but does not raise the CreatingCookie event.
Note: |
|---|
Do not call the ValidateUser method from code that is executing on the Web server. You call the ValidateUser method only as part of a WCF service. For more information, see ASP.NET Authentication. |
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: