AuthenticatingEventArgs.AuthenticationIsComplete プロパティ

定義

ユーザーの資格情報が認証されているかどうかを示す値を取得または設定します。

public:
 property bool AuthenticationIsComplete { bool get(); void set(bool value); };
public bool AuthenticationIsComplete { get; set; }
member this.AuthenticationIsComplete : bool with get, set
Public Property AuthenticationIsComplete As Boolean

プロパティ値

ユーザーの資格情報の妥当性を確認するすべてのステップが完了された場合は true、それ以外の場合は false

次の例は、カスタム メンバーシップ プロバイダーに 値と Password 値を渡UserNameしてユーザーの資格情報を検証するイベント ハンドラーを示しています。 イベント ハンドラーは、 メソッドの戻り値にValidateUser設定Authenticatedし、 を にtrue設定AuthenticationIsCompleteして、クラスがAuthenticationService資格情報を検証しないようにします。

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;
}
Sub AuthenticationService_Authenticating _
   (ByVal sender As Object, _
    ByVal e As System.Web.ApplicationServices.AuthenticatingEventArgs)
    
    If (e.Username.IndexOf("@contoso.com") >= 0) Then
        e.Authenticated = Membership.Providers("ContosoSqlProvider").ValidateUser(e.Username, e.Password)
    ElseIf (e.Username.IndexOf("@fabrikam.com") >= 0) Then
        e.Authenticated = Membership.Providers("FabrikamSqlProvider").ValidateUser(e.Username, e.Password)
    Else
        e.Authenticated = Membership.Provider.ValidateUser(e.Username, e.Password)
    End If
    e.AuthenticationIsComplete = True
End Sub

注釈

クラスがユーザー資格情報を AuthenticationIsComplete 認証する必要があるかどうかを AuthenticationService 示すように プロパティを設定できます。 が trueの場合AuthenticationIsCompleteAuthenticationServiceクラスは既定のメンバーシップ プロバイダーを介してユーザー資格情報を検証しません。 代わりに、 の Authenticated 値を使用して、認証 Cookie を作成するかどうかを決定します。

が の場合AuthenticationIsComplete、クラスはAuthenticationService既定のメンバーシップ プロバイダーを介してユーザーの資格情報を検証し、 プロパティの値をAuthenticated上書きfalseします。

適用対象

こちらもご覧ください