SecureConversationServiceCredential.SecurityStateEncoder 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
쿠키 serialization 인코딩 및 디코딩을 위해 사용자 지정된 항목을 SecurityStateEncoder 가져오거나 설정합니다.
public:
property System::ServiceModel::Security::SecurityStateEncoder ^ SecurityStateEncoder { System::ServiceModel::Security::SecurityStateEncoder ^ get(); void set(System::ServiceModel::Security::SecurityStateEncoder ^ value); };
public System.ServiceModel.Security.SecurityStateEncoder SecurityStateEncoder { get; set; }
member this.SecurityStateEncoder : System.ServiceModel.Security.SecurityStateEncoder with get, set
Public Property SecurityStateEncoder As SecurityStateEncoder
속성 값
SecurityStateEncoder 개체입니다. 이 개체는 .의 DataProtectionSecurityStateEncoder사용자 지정입니다.
예제
다음 코드에서는 이 속성을 설정하는 방법을 보여 있습니다.
static void Configure(ServiceHost serviceHost)
{
/*
* There are certain settings that cannot be configured via app.config.
* The security state encoder is one of them.
* Plug in a SecurityStateEncoder that uses the configured certificate
* to protect the security context token state.
*
* Note: You don't need a security state encoder for cookie mode. This was added to the
* sample to illustrate how you would plug in a custom security state encoder should
* your scenario require one.
* */
serviceHost.Credentials.SecureConversationAuthentication.SecurityStateEncoder =
new CertificateSecurityStateEncoder(serviceHost.Credentials.ServiceCertificate.Certificate);
설명
"쿠키 모드"에서 서비스는 보안 상태를 유지할 필요가 없도록 클라이언트에 쿠키 형식의 SCT(보안 컨텍스트 토큰)를 클라이언트에 발급합니다. 클라이언트는 서비스에서 요청 메시지를 보호 해제하고 확인하는 방법을 알 수 있도록 요청 메시지에서 쿠키를 다시 보냅니다. SCT는 종종 비안전 네트워크를 통해 전송되므로 보호해야 합니다.
기본적으로 Windows Communication Foundation(WCF)는 DataProtectionSecurityStateEncoder 클래스를 사용하여 DPAPI(Data Protection API)를 사용하여 쿠키를 보호합니다. DPAPI가 웹 팜 환경에서 작동하려면 모든 백 엔드 서비스가 동일한 도메인 사용자 계정으로 실행되어야 합니다. 즉, 서비스가 웹 호스팅인 경우 도메인 사용자로 실행되도록 IIS(인터넷 정보 서비스) 작업자 프로세스를 구성해야 합니다.
이 속성을 사용하면 사용자 지정 SecurityStateEncoder 을 사용하여 DPAPI에 의존하지 않고 쿠키를 암호화 및 암호 해독할 수 있습니다.