AuthenticationService::ValidateUser Method (String^, String^, String^)
Authenticates user credentials without issuing an authentication ticket.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
public: [OperationContractAttribute] 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 null. |
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.
TheValidateUser 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. |
Available since 3.5
