다음을 통해 공유


HttpDigestClientCredential.AllowedImpersonationLevel 속성

정의

클라이언트가 제공된 클라이언트 자격 증명과 함께 허용하는 가장 수준을 가져오거나 설정합니다.

public:
 property System::Security::Principal::TokenImpersonationLevel AllowedImpersonationLevel { System::Security::Principal::TokenImpersonationLevel get(); void set(System::Security::Principal::TokenImpersonationLevel value); };
public System.Security.Principal.TokenImpersonationLevel AllowedImpersonationLevel { get; set; }
member this.AllowedImpersonationLevel : System.Security.Principal.TokenImpersonationLevel with get, set
Public Property AllowedImpersonationLevel As TokenImpersonationLevel

속성 값

클라이언트가 HTTP 다이제스트 인증의 일부로 서버에 부여하는 TokenImpersonationLevel입니다.

예제

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

// Create a service host.
EndpointAddress ea = new EndpointAddress("http://localhost/Calculator");
WSHttpBinding b = new WSHttpBinding(SecurityMode.Transport);
b.Security.Transport.ClientCredentialType = HttpClientCredentialType.Digest;

// Create a client. The code is not shown here. See the WCF samples
// for an example of the CalculatorClient code.

CalculatorClient cc = new CalculatorClient(b, ea);
// Get a reference to the Windows client credential object.
HttpDigestClientCredential digestCred = cc.ClientCredentials.HttpDigest;
Console.WriteLine("AllowedImpersonationLevel: {0}",
    digestCred.AllowedImpersonationLevel);
Console.WriteLine("Domain: {0}", digestCred.ClientCredential.Domain);

Console.ReadLine();
// Change the AllowedImpersonationLevel.
digestCred.AllowedImpersonationLevel =
    System.Security.Principal.TokenImpersonationLevel.Impersonation;

Console.WriteLine("Changed AllowedImpersonationLevel: {0}",
    digestCred.AllowedImpersonationLevel);
Console.ReadLine();
// Open the calculator and use it.
//cc.Open();
//Console.WriteLine(cc.Add(11, 11));

//// Close the client.
//cc.Close();
' Create a service host.
Dim ea As New EndpointAddress("http://localhost/Calculator")
Dim b As New WSHttpBinding(SecurityMode.Transport)
b.Security.Transport.ClientCredentialType = _
HttpClientCredentialType.Digest

' Create a client. The code is not shown here. See the WCF samples
' for an example of the CalculatorClient code.
Dim cc As New CalculatorClient(b, ea)
' Get a reference to the Windows client credential object.
Dim digestCred As HttpDigestClientCredential = cc.ClientCredentials.HttpDigest
Console.WriteLine("AllowedImpersonationLevel: {0}", _
                 digestCred.AllowedImpersonationLevel)
Console.WriteLine("Domain: {0}", digestCred.ClientCredential.Domain)

Console.ReadLine()
' Change the AllowedImpersonationLevel.
digestCred.AllowedImpersonationLevel = _
System.Security.Principal.TokenImpersonationLevel.Impersonation

Console.WriteLine("Changed AllowedImpersonationLevel: {0}", _
digestCred.AllowedImpersonationLevel)
Console.ReadLine()
' Open the calculator and use it.
' cc.Open()
' Console.WriteLine(cc.Add(11, 11))
' Close the client.
' cc.Close()

설명

허용되는 값은 다음과 같습니다.

Delegation,

Identification

Impersonation.

다이제스트 인증의 제한으로 인해 클라이언트가 기본이 아닌 자격 증명을 사용하는 경우 및 Delegation 수준만 Impersonation 허용됩니다.

적용 대상