Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

AuthenticatingEventArgs.AuthenticationIsComplete Property

Gets or sets a value that indicates whether the user credentials have been authenticated.

Namespace:  System.Web.ApplicationServices
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)
public bool AuthenticationIsComplete { get; set; }

Property Value

Type: System.Boolean
true if all the steps for validating the user credentials have been performed; otherwise, false.

You can set the AuthenticationIsComplete property to indicate whether the AuthenticationService class must authenticate the user credentials. If AuthenticationIsComplete is true, the AuthenticationService class does not validate the user credentials through the default membership provider. Instead, it uses the value in Authenticated to determine whether to create an authentication cookie.

If AuthenticationIsComplete is false, the AuthenticationService class validates the user credentials through the default membership provider and overwrites the value in the Authenticated property.

The following example shows an event handler that passes UserName and Password values to a custom membership provider to validate the user credentials. The event handler sets Authenticated to the return value of the ValidateUser method and sets AuthenticationIsComplete to true so that the AuthenticationService class does not validate the credentials.

void AuthenticationService_Authenticating(object sender, System.Web.ApplicationServices.AuthenticatingEventArgs e)
{
    if (e.UserName.IndexOf("@contoso.com") >= 0)
    {
        e.Authenticated = Membership.Providers["ContosoSqlProvider"].ValidateUser(e.UserName, e.Password);
    }
    else if (e.UserName.IndexOf("@fabrikam.com") >= 0)
    {
        e.Authenticated = Membership.Providers["FabrikamSqlProvider"].ValidateUser(e.UserName, e.Password);
    }
    else
    {
        e.Authenticated = Membership.Provider.ValidateUser(e.UserName, e.Password);
    }
    e.AuthenticationIsComplete = true;
}

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.