NegotiateStream.ImpersonationLevel 속성

정의

서버에서 클라이언트의 자격 증명을 사용하는 방법을 나타내는 값을 가져옵니다.

public:
 virtual property System::Security::Principal::TokenImpersonationLevel ImpersonationLevel { System::Security::Principal::TokenImpersonationLevel get(); };
public virtual System.Security.Principal.TokenImpersonationLevel ImpersonationLevel { get; }
member this.ImpersonationLevel : System.Security.Principal.TokenImpersonationLevel
Public Overridable ReadOnly Property ImpersonationLevel As TokenImpersonationLevel

속성 값

TokenImpersonationLevel 값 중 하나입니다.

예외

인증이 실패하거나 수행되지 않은 경우

예제

다음 코드 예제에서는이 속성의 값을 표시 합니다.

static void DisplayAuthenticationProperties( NegotiateStream^ stream )
{
   Console::WriteLine( L"IsAuthenticated: {0}", stream->IsAuthenticated );
   Console::WriteLine( L"IsMutuallyAuthenticated: {0}", stream->IsMutuallyAuthenticated );
   Console::WriteLine( L"IsEncrypted: {0}", stream->IsEncrypted );
   Console::WriteLine( L"IsSigned: {0}", stream->IsSigned );
   Console::WriteLine( L"ImpersonationLevel: {0}", stream->ImpersonationLevel );
   Console::WriteLine( L"IsServer: {0}", stream->IsServer );
}


 static void DisplayAuthenticationProperties(NegotiateStream stream)
{
     Console.WriteLine("IsAuthenticated: {0}", stream.IsAuthenticated);
    Console.WriteLine("IsMutuallyAuthenticated: {0}", stream.IsMutuallyAuthenticated);
    Console.WriteLine("IsEncrypted: {0}", stream.IsEncrypted);
    Console.WriteLine("IsSigned: {0}", stream.IsSigned);
    Console.WriteLine("ImpersonationLevel: {0}", stream.ImpersonationLevel);
    Console.WriteLine("IsServer: {0}", stream.IsServer);
}

설명

이 메서드를 호출하기 전에 성공적으로 인증해야 합니다. 클라이언트는 또는 BeginAuthenticateAsClient 메서드 중 AuthenticateAsClient 하나를 호출하여 인증을 요청할 때 가장 수준을 지정합니다. 를 지정하지 않고 인증하는 TokenImpersonationLevelIdentification 경우 가 사용됩니다.

적용 대상