AuthenticationService.ValidateUser(String, String, String) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Authenticates user credentials without issuing an authentication ticket.
public:
bool ValidateUser(System::String ^ username, System::String ^ password, System::String ^ customCredential);
[System.ServiceModel.OperationContract]
public bool ValidateUser(string username, string password, string customCredential);
[<System.ServiceModel.OperationContract>]
member this.ValidateUser : string * string * string -> bool
Public Function ValidateUser (username As String, password As String, customCredential As String) As Boolean
- username
- String
The user name to be validated.
- password
- String
The password for the specified user.
- customCredential
- String
The value or values to validate in addition to username
and password
, if any.
true
if the user credentials are valid; otherwise, false
.
- Attributes
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.
The ValidateUser method raises the Authenticating event, but does not raise the CreatingCookie event.
Σημείωση
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.
Προϊόν | Εκδόσεις |
---|---|
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET σχόλια
.NET είναι ένα έργο ανοιχτού κώδικα. Επιλέξτε μια σύνδεση για να παρέχετε σχόλια: