UserNamePasswordValidationMode 열거형

정의

사용자 이름/암호 모드에서의 유효성 검사 방법을 나열합니다.

public enum class UserNamePasswordValidationMode
public enum UserNamePasswordValidationMode
type UserNamePasswordValidationMode = 
Public Enum UserNamePasswordValidationMode
상속
UserNamePasswordValidationMode

필드

Custom 2

구성된 사용자 지정 UserNamePasswordValidator를 기반으로 한 사용자 지정 인증입니다.

MembershipProvider 1

구성된 MembershipProvider를 기반으로 한 암호 유효성 검사를 제공합니다.

Windows 0

사용자 이름은 Windows 사용자에 매핑됩니다.

예제

이 예제에서는 이 속성을 설정하는 방법을 보여 줍니다.

// Host the service within this EXE console application.
public static void Main()
{
    // Create a ServiceHost for the CalculatorService type and provide the base address.
    using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService)))
    {
        serviceHost.Credentials.UserNameAuthentication.UserNamePasswordValidationMode = UserNamePasswordValidationMode.Custom;
        serviceHost.Credentials.UserNameAuthentication.CustomUserNamePasswordValidator = new MyUserNamePasswordValidator();

        // Open the ServiceHostBase to create listeners and start listening for messages.
        serviceHost.Open();

        // The service can now be accessed.
        Console.WriteLine("The service is ready.");
        Console.WriteLine("The service is running in the following account: {0}", WindowsIdentity.GetCurrent().Name);
        Console.WriteLine("Press <ENTER> to terminate service.");
        Console.WriteLine();
        Console.ReadLine();
    }
}

설명

이 열거형은 UserNameServiceElement, ServiceCredentialsSecurityTokenManagerUserNamePasswordServiceCredential에 의해 참조됩니다.

적용 대상