IClientFormsAuthenticationCredentialsProvider 인터페이스

정의

사용자 자격 증명을 검색하기 위해 ClientFormsAuthenticationMembershipProvider 클래스가 호출하는 메서드를 정의합니다.

public interface class IClientFormsAuthenticationCredentialsProvider
public interface IClientFormsAuthenticationCredentialsProvider
type IClientFormsAuthenticationCredentialsProvider = interface
Public Interface IClientFormsAuthenticationCredentialsProvider

예제

다음 예제 코드를 구현 하는 방법에 설명 합니다 GetCredentials 메서드는이 인터페이스에서 유일한 멤버입니다. 이 예제는 GetCredentials 메서드는 로그인 대화 상자 클래스의 일부입니다. 이 메서드는 대화 상자를 표시 하 고 다음 반환을 ClientFormsAuthenticationCredentials 인스턴스 사용자 지정 값으로 초기화 합니다.

public ClientFormsAuthenticationCredentials GetCredentials()
{
    if (this.ShowDialog() == DialogResult.OK)
    {
        return new ClientFormsAuthenticationCredentials(
            usernameTextBox.Text, passwordTextBox.Text,
            rememberMeCheckBox.Checked);
    }
    else
    {
        return null;
    }
}
Public Function GetCredentials() As  _
    ClientFormsAuthenticationCredentials Implements _
    IClientFormsAuthenticationCredentialsProvider.GetCredentials

    If Me.ShowDialog() = DialogResult.OK Then
        Return New ClientFormsAuthenticationCredentials( _
            UsernameTextBox.Text, PasswordTextBox.Text, _
            rememberMeCheckBox.Checked)
    Else
        Return Nothing
    End If

End Function

설명

사용자 이름 및 암호를 전달할 수 있습니다 클라이언트 애플리케이션 서비스를 사용 하 여 폼 인증을 사용 하는 경우는 ValidateUser 메서드. 자격 증명 공급자를 사용하기 위해 빈 문자열이나 null을 매개 변수로 전달할 수도 있습니다. 자격 증명 공급자는 애플리케이션 구성에서 제공하고 지정하는 클래스입니다. 자격 증명 공급자 클래스는 GetCredentials라는 단일 메서드가 들어 있는 IClientFormsAuthenticationCredentialsProvider 인터페이스를 구현해야 합니다. 일반적인 GetCredentials 메서드 구현에는 사용자 입력을 검색 하는 대화 상자가 표시 됩니다. 자격 증명 공급자를 사용하면 여러 애플리케이션에서 단일 로그인 대화 상자를 공유할 수 있습니다.

메서드

GetCredentials()

사용자 자격 증명을 검색합니다.

적용 대상

추가 정보