X509ClientCertificateAuthentication.MapClientCertificateToWindowsAccount 속성

정의

인증서가 Windows 계정에 매핑되는지 여부를 나타내는 값을 가져오거나 설정합니다.

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

속성 값

Boolean

인증서가 Windows 계정에 매핑되면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예외

자격 증명이 읽기 전용일 때 set인 경우

예제

다음 코드에서는 이 속성을 설정하는 방법을 보여 줍니다.

// Create a service host.
Uri httpUri = new Uri("http://localhost/Calculator");
ServiceHost sh = new ServiceHost(typeof(Calculator), httpUri);

// Create a binding that uses Windows security.
WSHttpBinding b = new WSHttpBinding(SecurityMode.Message);
b.Security.Message.ClientCredentialType = MessageCredentialType.Windows;

// Get a reference to the authentication object.
X509ClientCertificateAuthentication myAuthProperties =
    sh.Credentials.ClientCertificate.Authentication;
// Configure IncludeWindowsGroups.
myAuthProperties.IncludeWindowsGroups = true;
' Create a service host.
Dim httpUri As New Uri("http://localhost/Calculator")
Dim sh As New ServiceHost(GetType(Calculator), httpUri)

' Create a binding that uses Windows security.
Dim b As New WSHttpBinding(SecurityMode.Message)
b.Security.Message.ClientCredentialType = MessageCredentialType.Windows

' Get a reference to the authentication object.
Dim myAuthProperties As X509ClientCertificateAuthentication = _
sh.Credentials.ClientCertificate.Authentication
' Configure IncludeWindowsGroups.
myAuthProperties.IncludeWindowsGroups = True

구성 파일에서도 속성을 설정할 수 있습니다.

<serviceCredentials>  
  <clientCertificate>  
     <authentication mapClientCertificateToWindowsAccount='true'/>  
  </clientCertificate>  
</serviceCredentials>  

설명

바인딩에서 인증서 클라이언트 자격 증명 형식을 사용할 때 해당 인증서는 Windows 계정으로 매핑되지 않습니다. 이 속성을 사용하여 이 동작을 재정의할 수 있습니다. 이 속성을 true로 설정하면 클라이언트 인증서의 ID가 Windows 계정으로 매핑될 수 있습니다.

적용 대상