System.Web.Security.FormsAuthentication.Authenticate Method

Validates a user name and password against credentials stored in the configuration file for an application.

Syntax

public static bool Authenticate (string name, string password)

Parameters

name
The user name.
password
The password for the user.

Returns

true if the user name and password are valid; otherwise, false.

Remarks

The Authenticate method verifies user credentials that are stored in the credentials section of the application configuration file. Alternatively, you can use ASP.NET membership to store user credentials and call the MembershipProvider.ValidateUser(string, string) to verify the credentials. For more information, see Managing Users By Using ASP.NET Membership.

For improved security, you can encrypt passwords stored in the configuration file for an application by using the FormsAuthentication.HashPasswordForStoringInConfigFile(string, string) method.

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0