AuthenticatingEventArgs 클래스

정의

Authenticating 이벤트에 대한 데이터를 제공합니다.

public ref class AuthenticatingEventArgs : EventArgs
public class AuthenticatingEventArgs : EventArgs
type AuthenticatingEventArgs = class
    inherit EventArgs
Public Class AuthenticatingEventArgs
Inherits EventArgs
상속
AuthenticatingEventArgs

예제

다음 예제에서는 전달 하는 이벤트 처리기를 UserNamePassword 값을 사용자 지정 멤버 자격 공급자에 사용자 자격 증명의 유효성을 검사 합니다. 이벤트 처리기에서 설정 Authenticated 의 반환 값에는 ValidateUser 메서드 집합과 AuthenticationIsCompletetrue 있도록는 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

설명

에 대 한 처리기를 만든를 Authenticating 런타임 시 사용자의 자격 증명을 인증 하는 방법을 사용자 지정 하려는 경우에 이벤트입니다. 합니다 AuthenticatingEventArgs 에 값을 제공 하는 클래스 Authenticating 이벤트 처리기입니다. 이 클래스에서 사용할 수 있는 속성을 사용 하 여 인증을 사용자 지정 사용자 자격 증명을 검색할 수 있습니다.

합니다 AuthenticationService 클래스에서 발생 시키는 Authenticating 사용자 자격 증명의 유효성을 검사 하기 전에 이벤트입니다. 합니다 AuthenticationService 클래스의 인스턴스를 생성 합니다 AuthenticatingEventArgs 개체를 전달 합니다 Authenticating 이벤트 처리기입니다.

사용할 수는 UserName, PasswordCustomCredential 사용자 자격 증명을 검색할 속성입니다. CustomCredential 속성 id와 같은 인증에 필요한 추가 값을 포함할 수 있습니다.

Authenticated 속성 사용자 자격 증명이 유효한 지 여부를 나타냅니다. 설정한는 Authenticated 속성을 사용자 지정된 인증의 결과입니다. 설정 하는 또한 합니다 AuthenticationIsComplete 속성을 true 사용자 자격 증명을 확인 한를 원하지 않는 AuthenticationService 기본 멤버 자격 공급자를 통해 사용자 자격 증명을 확인 하는 클래스입니다.

속성

Authenticated

사용자 자격 증명이 유효한지 여부를 나타내는 값을 가져오거나 설정합니다.

AuthenticationIsComplete

사용자 자격 증명이 인증되었는지 여부를 나타내는 값을 가져오거나 설정합니다.

CustomCredential

인증을 위한 추가 사용자 값을 가져옵니다.

Password

사용자의 암호를 가져옵니다.

UserName

사용자의 인증 이름을 가져옵니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상

추가 정보