NegotiateStream.BeginAuthenticateAsClient 메서드

정의

클라이언트-서버 연결의 클라이언트측을 인증하는 비동기 작업을 시작합니다.

오버로드

BeginAuthenticateAsClient(AsyncCallback, Object)

클라이언트-서버 연결에서 클라이언트를 인증하고 선택적으로 서버를 인증하는 비동기 작업을 시작하기 위해 클라이언트에서 호출합니다. 이 메서드는 차단되지 않습니다.

BeginAuthenticateAsClient(NetworkCredential, String, AsyncCallback, Object)

클라이언트-서버 연결에서 클라이언트를 인증하고 선택적으로 서버를 인증하는 비동기 작업을 시작하기 위해 클라이언트에서 호출합니다. 인증 프로세스는 지정된 자격 증명을 사용합니다. 이 메서드는 차단되지 않습니다.

BeginAuthenticateAsClient(NetworkCredential, ChannelBinding, String, AsyncCallback, Object)

클라이언트-서버 연결에서 클라이언트를 인증하고 선택적으로 서버를 인증하는 비동기 작업을 시작하기 위해 클라이언트에서 호출합니다. 인증 프로세스는 지정된 자격 증명과 채널 바인딩을 사용합니다. 이 메서드는 차단되지 않습니다.

BeginAuthenticateAsClient(NetworkCredential, String, ProtectionLevel, TokenImpersonationLevel, AsyncCallback, Object)

클라이언트-서버 연결에서 클라이언트를 인증하고 선택적으로 서버를 인증하는 비동기 작업을 시작하기 위해 클라이언트에서 호출합니다. 인증 프로세스는 지정된 자격 증명과 인증 옵션을 사용합니다. 이 메서드는 차단되지 않습니다.

BeginAuthenticateAsClient(NetworkCredential, ChannelBinding, String, ProtectionLevel, TokenImpersonationLevel, AsyncCallback, Object)

클라이언트-서버 연결에서 클라이언트를 인증하고 선택적으로 서버를 인증하는 비동기 작업을 시작하기 위해 클라이언트에서 호출합니다. 인증 프로세스는 지정된 자격 증명, 인증 옵션 및 채널 바인딩이 사용합니다. 이 메서드는 차단되지 않습니다.

설명

인증이 진행되는 동안에는 이 메서드의 오버로드가 차단되지 않습니다. 인증이 완료되는 동안 차단하려면 메서드 중 AuthenticateAsClient 하나를 사용합니다.

BeginAuthenticateAsClient(AsyncCallback, Object)

Source:
NegotiateStream.cs
Source:
NegotiateStream.cs
Source:
NegotiateStream.cs

클라이언트-서버 연결에서 클라이언트를 인증하고 선택적으로 서버를 인증하는 비동기 작업을 시작하기 위해 클라이언트에서 호출합니다. 이 메서드는 차단되지 않습니다.

public:
 virtual IAsyncResult ^ BeginAuthenticateAsClient(AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (AsyncCallback? asyncCallback, object? asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (AsyncCallback asyncCallback, object asyncState);
abstract member BeginAuthenticateAsClient : AsyncCallback * obj -> IAsyncResult
override this.BeginAuthenticateAsClient : AsyncCallback * obj -> IAsyncResult
Public Overridable Function BeginAuthenticateAsClient (asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult

매개 변수

asyncCallback
AsyncCallback

인증이 완료되었을 때 호출할 매서드를 참조하는 AsyncCallback 대리자입니다.

asyncState
Object

작업에 대한 정보가 들어 있는 사용자 정의 개체입니다. 작업이 완료되면 asyncCallback 대리자에게 전달되는 개체입니다.

반환

비동기 작업의 상태를 표시하는 IAsyncResult 개체입니다.

예외

인증이 실패한 경우. 이 개체를 사용하여 인증을 다시 시도할 수 있습니다.

인증이 실패한 경우. 이 개체를 사용하여 인증을 다시 시도할 수 있습니다.

이 개체가 닫힌 경우.

인증이 이미 발생한 경우.

또는

이전에 이 스트림을 사용하여 서버로 인증을 시도한 경우. 해당 스트림을 사용하여 클라이언트로 인증을 다시 시도할 수는 없습니다.

예제

다음 예제에서는 이 메서드를 호출하여 클라이언트에 대한 비동기 인증을 시작하는 방법을 보여 줍니다.

// Establish the remote endpoint for the socket.
// For this example, use the local machine.
IPHostEntry^ ipHostInfo = Dns::GetHostEntry( Dns::GetHostName() );
IPAddress^ ipAddress = ipHostInfo->AddressList[ 0 ];

// Client and server use port 11000. 
IPEndPoint^ remoteEP = gcnew IPEndPoint( ipAddress,11000 );

// Create a TCP/IP socket.
client = gcnew TcpClient;

// Connect the socket to the remote endpoint.
client->Connect( remoteEP );
Console::WriteLine( L"Client connected to {0}.", remoteEP );

// Ensure the client does not close when there is 
// still data to be sent to the server.
client->LingerState = (gcnew LingerOption( true,0 ));

// Request authentication.
NetworkStream^ clientStream = client->GetStream();
NegotiateStream^ authStream = gcnew NegotiateStream( clientStream,false );

// Pass the NegotiateStream as the AsyncState object 
// so that it is available to the callback delegate.
IAsyncResult^ ar = authStream->BeginAuthenticateAsClient( gcnew AsyncCallback( EndAuthenticateCallback ), authStream );

// Establish the remote endpoint for the socket.
// For this example, use the local machine.
IPHostEntry ipHostInfo = Dns.GetHostEntry("localhost");
IPAddress ipAddress = ipHostInfo.AddressList[0];
// Client and server use port 11000.
IPEndPoint remoteEP = new IPEndPoint(ipAddress, 11000);
// Create a TCP/IP socket.
client = new TcpClient();
// Connect the socket to the remote endpoint.
client.Connect(remoteEP);
Console.WriteLine("Client connected to {0}.", remoteEP.ToString());
// Ensure the client does not close when there is
// still data to be sent to the server.
client.LingerState = new LingerOption(true, 0);
// Request authentication.
NetworkStream clientStream = client.GetStream();
NegotiateStream authStream = new NegotiateStream(clientStream, false);
// Pass the NegotiateStream as the AsyncState object
// so that it is available to the callback delegate.
Task authenticateTask = authStream
    .AuthenticateAsClientAsync()
    .ContinueWith(task =>
    {
        Console.WriteLine("Client ending authentication...");
        Console.WriteLine("ImpersonationLevel: {0}", authStream.ImpersonationLevel);
    });

' Establish the remote endpoint for the socket.
' For this example, use the local machine.
Dim ipHostInfo = Dns.GetHostEntry("localhost")
Dim ipAddress = ipHostInfo.AddressList(0)

' Client and server use port 11000. 
Dim remoteEP As New IPEndPoint(ipAddress, 11000)

' Create a TCP/IP socket.
client = New TcpClient()

' Connect the socket to the remote endpoint.
client.Connect(remoteEP)
Console.WriteLine("Client connected to {0}.", remoteEP.ToString())

' Ensure the client does not close when there is 
' still data to be sent to the server.
client.LingerState = (New LingerOption(True, 0))

' Request authentication.
Dim clientStream = client.GetStream()
Dim authStream As New NegotiateStream(clientStream, False)

' Pass the NegotiateStream as the AsyncState object 
' so that it is available to the callback delegate.
Dim ar = authStream.BeginAuthenticateAsClient(
    New AsyncCallback(AddressOf EndAuthenticateCallback), authStream)

설명

인증은 클라이언트의 DefaultCredentials를 사용합니다. 서버에 대해 SPN(서비스 사용자 이름)이 지정되지 않았습니다. 가장 수준은 이 Identification고 보안 수준은 입니다 EncryptAndSign. 클래스는 NegotiateStream 상호 인증에 사용되는 SPN을 생성합니다.

이 메서드는 비동기이며 작업이 완료되는 동안 차단되지 않습니다. 작업이 완료될 때까지 차단하려면 메서드 오버로드 중 AuthenticateAsClient 하나를 사용합니다.

메서드를 호출 EndAuthenticateAsClient 하여 비동기 인증 작업을 완료해야 합니다. 일반적으로 메서드는 대리자에서 호출됩니다 asyncCallback . 비동기 프로그래밍 모델 사용에 대한 자세한 내용은 동기 메서드 비동기 호출을 참조하세요.

인증에 실패하면 또는 를 AuthenticationExceptionInvalidCredentialException받게 됩니다. 이 경우 다른 자격 증명을 사용하여 인증을 다시 시도할 수 있습니다.

적용 대상

BeginAuthenticateAsClient(NetworkCredential, String, AsyncCallback, Object)

Source:
NegotiateStream.cs
Source:
NegotiateStream.cs
Source:
NegotiateStream.cs

클라이언트-서버 연결에서 클라이언트를 인증하고 선택적으로 서버를 인증하는 비동기 작업을 시작하기 위해 클라이언트에서 호출합니다. 인증 프로세스는 지정된 자격 증명을 사용합니다. 이 메서드는 차단되지 않습니다.

public:
 virtual IAsyncResult ^ BeginAuthenticateAsClient(System::Net::NetworkCredential ^ credential, System::String ^ targetName, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, string targetName, AsyncCallback? asyncCallback, object? asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, string targetName, AsyncCallback asyncCallback, object asyncState);
abstract member BeginAuthenticateAsClient : System.Net.NetworkCredential * string * AsyncCallback * obj -> IAsyncResult
override this.BeginAuthenticateAsClient : System.Net.NetworkCredential * string * AsyncCallback * obj -> IAsyncResult
Public Overridable Function BeginAuthenticateAsClient (credential As NetworkCredential, targetName As String, asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult

매개 변수

credential
NetworkCredential

클라이언트의 ID를 설정하는 데 사용되는 NetworkCredential입니다.

targetName
String

인증할 서버를 고유하게 식별하는 SPN(서비스 사용자 이름)입니다.

asyncCallback
AsyncCallback

인증이 완료되었을 때 호출할 매서드를 참조하는 AsyncCallback 대리자입니다.

asyncState
Object

쓰기 작업에 대한 정보가 포함된 사용자 정의 개체입니다. 작업이 완료되면 asyncCallback 대리자에게 전달되는 개체입니다.

반환

비동기 작업의 상태를 표시하는 IAsyncResult 개체입니다.

예외

credentialnull입니다.

또는

targetName이(가) null인 경우

인증이 실패한 경우. 이 개체를 사용하여 인증을 다시 시도할 수 있습니다.

인증이 실패한 경우. 이 개체를 사용하여 인증을 다시 시도할 수 있습니다.

이 개체가 닫힌 경우.

인증이 이미 발생한 경우.

또는

이전에 이 스트림을 사용하여 서버로 인증을 시도한 경우. 해당 스트림을 사용하여 클라이언트로 인증을 다시 시도할 수는 없습니다.

설명

이 메서드는 비동기이며 작업이 완료되는 동안 차단되지 않습니다. 작업이 완료될 때까지 차단하려면 메서드 오버로드 중 AuthenticateAsClient 하나를 사용합니다.

메서드를 호출 EndAuthenticateAsClient 하여 비동기 인증 작업을 완료해야 합니다. 일반적으로 메서드는 대리자에서 호출됩니다 asyncCallback . 비동기 프로그래밍 모델 사용에 대한 자세한 내용은 동기 메서드 비동기 호출을 참조하세요.

인증에 실패하면 또는 를 AuthenticationExceptionInvalidCredentialException받게 됩니다. 이 경우 다른 자격 증명을 사용하여 인증을 다시 시도할 수 있습니다.

적용 대상

BeginAuthenticateAsClient(NetworkCredential, ChannelBinding, String, AsyncCallback, Object)

Source:
NegotiateStream.cs
Source:
NegotiateStream.cs
Source:
NegotiateStream.cs

클라이언트-서버 연결에서 클라이언트를 인증하고 선택적으로 서버를 인증하는 비동기 작업을 시작하기 위해 클라이언트에서 호출합니다. 인증 프로세스는 지정된 자격 증명과 채널 바인딩을 사용합니다. 이 메서드는 차단되지 않습니다.

public:
 virtual IAsyncResult ^ BeginAuthenticateAsClient(System::Net::NetworkCredential ^ credential, System::Security::Authentication::ExtendedProtection::ChannelBinding ^ binding, System::String ^ targetName, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, System.Security.Authentication.ExtendedProtection.ChannelBinding? binding, string targetName, AsyncCallback? asyncCallback, object? asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, System.Security.Authentication.ExtendedProtection.ChannelBinding binding, string targetName, AsyncCallback asyncCallback, object asyncState);
abstract member BeginAuthenticateAsClient : System.Net.NetworkCredential * System.Security.Authentication.ExtendedProtection.ChannelBinding * string * AsyncCallback * obj -> IAsyncResult
override this.BeginAuthenticateAsClient : System.Net.NetworkCredential * System.Security.Authentication.ExtendedProtection.ChannelBinding * string * AsyncCallback * obj -> IAsyncResult
Public Overridable Function BeginAuthenticateAsClient (credential As NetworkCredential, binding As ChannelBinding, targetName As String, asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult

매개 변수

credential
NetworkCredential

클라이언트의 ID를 설정하는 데 사용되는 NetworkCredential입니다.

binding
ChannelBinding

확장 보호에 사용되는 ChannelBinding입니다.

targetName
String

인증할 서버를 고유하게 식별하는 SPN(서비스 사용자 이름)입니다.

asyncCallback
AsyncCallback

인증이 완료되었을 때 호출할 매서드를 참조하는 AsyncCallback 대리자입니다.

asyncState
Object

쓰기 작업에 대한 정보가 포함된 사용자 정의 개체입니다. 작업이 완료되면 asyncCallback 대리자에게 전달되는 개체입니다.

반환

비동기 작업의 상태를 표시하는 IAsyncResult 개체입니다.

예외

credentialnull입니다.

또는

targetName이(가) null인 경우

인증이 실패한 경우. 이 개체를 사용하여 인증을 다시 시도할 수 있습니다.

인증이 실패한 경우. 이 개체를 사용하여 인증을 다시 시도할 수 있습니다.

인증이 이미 발생한 경우.

또는

이전에 이 스트림을 사용하여 서버로 인증을 시도한 경우. 해당 스트림을 사용하여 클라이언트로 인증을 다시 시도할 수는 없습니다.

이 개체가 닫힌 경우.

설명

이 메서드는 비동기이며 작업이 완료되는 동안 차단되지 않습니다. 작업이 완료될 때까지 차단하려면 메서드 오버로드 중 AuthenticateAsClient 하나를 사용합니다.

메서드를 호출 EndAuthenticateAsClient 하여 비동기 인증 작업을 완료해야 합니다. 일반적으로 메서드는 대리자에서 호출됩니다 asyncCallback . 비동기 프로그래밍 모델 사용에 대한 자세한 내용은 동기 메서드 비동기 호출을 참조하세요.

인증에 실패하면 또는 가 AuthenticationExceptionInvalidCredentialException수신됩니다. 이 경우 다른 자격 증명을 사용하여 인증을 다시 시도할 수 있습니다.

추가 정보

적용 대상

BeginAuthenticateAsClient(NetworkCredential, String, ProtectionLevel, TokenImpersonationLevel, AsyncCallback, Object)

Source:
NegotiateStream.cs
Source:
NegotiateStream.cs
Source:
NegotiateStream.cs

클라이언트-서버 연결에서 클라이언트를 인증하고 선택적으로 서버를 인증하는 비동기 작업을 시작하기 위해 클라이언트에서 호출합니다. 인증 프로세스는 지정된 자격 증명과 인증 옵션을 사용합니다. 이 메서드는 차단되지 않습니다.

public:
 virtual IAsyncResult ^ BeginAuthenticateAsClient(System::Net::NetworkCredential ^ credential, System::String ^ targetName, System::Net::Security::ProtectionLevel requiredProtectionLevel, System::Security::Principal::TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, string targetName, System.Net.Security.ProtectionLevel requiredProtectionLevel, System.Security.Principal.TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback? asyncCallback, object? asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, string targetName, System.Net.Security.ProtectionLevel requiredProtectionLevel, System.Security.Principal.TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback asyncCallback, object asyncState);
abstract member BeginAuthenticateAsClient : System.Net.NetworkCredential * string * System.Net.Security.ProtectionLevel * System.Security.Principal.TokenImpersonationLevel * AsyncCallback * obj -> IAsyncResult
override this.BeginAuthenticateAsClient : System.Net.NetworkCredential * string * System.Net.Security.ProtectionLevel * System.Security.Principal.TokenImpersonationLevel * AsyncCallback * obj -> IAsyncResult
Public Overridable Function BeginAuthenticateAsClient (credential As NetworkCredential, targetName As String, requiredProtectionLevel As ProtectionLevel, allowedImpersonationLevel As TokenImpersonationLevel, asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult

매개 변수

credential
NetworkCredential

클라이언트의 ID를 설정하는 데 사용되는 NetworkCredential입니다.

targetName
String

인증할 서버를 고유하게 식별하는 SPN(서비스 사용자 이름)입니다.

requiredProtectionLevel
ProtectionLevel

스트림의 보안 서비스를 나타내는 ProtectionLevel 값 중 하나입니다.

allowedImpersonationLevel
TokenImpersonationLevel

서버에서 클라이언트의 자격 증명을 사용하여 리소스에 액세스하는 방법을 나타내는 TokenImpersonationLevel 값 중 하나입니다.

asyncCallback
AsyncCallback

인증이 완료되었을 때 호출할 매서드를 참조하는 AsyncCallback 대리자입니다.

asyncState
Object

쓰기 작업에 대한 정보가 포함된 사용자 정의 개체입니다. 작업이 완료되면 asyncCallback 대리자에게 전달되는 개체입니다.

반환

비동기 작업의 상태를 표시하는 IAsyncResult 개체입니다.

예외

credentialnull입니다.

또는

targetName이(가) null인 경우

인증이 실패한 경우. 이 개체를 사용하여 인증을 다시 시도할 수 있습니다.

인증이 실패한 경우. 이 개체를 사용하여 인증을 다시 시도할 수 있습니다.

이 개체가 닫힌 경우.

인증이 이미 발생한 경우.

또는

이전에 이 스트림을 사용하여 서버로 인증을 시도한 경우. 해당 스트림을 사용하여 클라이언트로 인증을 다시 시도할 수는 없습니다.

설명

매개 변수를 requiredProtectionLevel 사용하여 인증된 스트림을 사용하여 전송되는 데이터에 대한 보안 서비스를 요청합니다. 예를 들어 데이터를 암호화하고 서명하려면 값을 지정합니다 EncryptAndSign . 인증에 성공했다고 해서 요청 ProtectionLevel 된 가 부여되었음을 보장하지는 않습니다. 및 IsSigned 속성을 검사 IsEncrypted 에서 사용되는 NegotiateStream보안 서비스를 결정해야 합니다.

이 메서드는 비동기이며 작업이 완료되는 동안 차단되지 않습니다. 작업이 완료될 때까지 차단하려면 메서드 오버로드 중 AuthenticateAsClient 하나를 사용합니다.

메서드를 호출 EndAuthenticateAsClient 하여 비동기 인증 작업을 완료해야 합니다. 일반적으로 메서드는 대리자에서 호출됩니다 asyncCallback . 비동기 프로그래밍 모델 사용에 대한 자세한 내용은 동기 메서드 비동기 호출을 참조하세요.

인증에 실패하면 또는 가 AuthenticationExceptionInvalidCredentialException수신됩니다. 이 경우 다른 자격 증명을 사용하여 인증을 다시 시도할 수 있습니다.

적용 대상

BeginAuthenticateAsClient(NetworkCredential, ChannelBinding, String, ProtectionLevel, TokenImpersonationLevel, AsyncCallback, Object)

Source:
NegotiateStream.cs
Source:
NegotiateStream.cs
Source:
NegotiateStream.cs

클라이언트-서버 연결에서 클라이언트를 인증하고 선택적으로 서버를 인증하는 비동기 작업을 시작하기 위해 클라이언트에서 호출합니다. 인증 프로세스는 지정된 자격 증명, 인증 옵션 및 채널 바인딩이 사용합니다. 이 메서드는 차단되지 않습니다.

public:
 virtual IAsyncResult ^ BeginAuthenticateAsClient(System::Net::NetworkCredential ^ credential, System::Security::Authentication::ExtendedProtection::ChannelBinding ^ binding, System::String ^ targetName, System::Net::Security::ProtectionLevel requiredProtectionLevel, System::Security::Principal::TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback ^ asyncCallback, System::Object ^ asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, System.Security.Authentication.ExtendedProtection.ChannelBinding? binding, string targetName, System.Net.Security.ProtectionLevel requiredProtectionLevel, System.Security.Principal.TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback? asyncCallback, object? asyncState);
public virtual IAsyncResult BeginAuthenticateAsClient (System.Net.NetworkCredential credential, System.Security.Authentication.ExtendedProtection.ChannelBinding binding, string targetName, System.Net.Security.ProtectionLevel requiredProtectionLevel, System.Security.Principal.TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback asyncCallback, object asyncState);
abstract member BeginAuthenticateAsClient : System.Net.NetworkCredential * System.Security.Authentication.ExtendedProtection.ChannelBinding * string * System.Net.Security.ProtectionLevel * System.Security.Principal.TokenImpersonationLevel * AsyncCallback * obj -> IAsyncResult
override this.BeginAuthenticateAsClient : System.Net.NetworkCredential * System.Security.Authentication.ExtendedProtection.ChannelBinding * string * System.Net.Security.ProtectionLevel * System.Security.Principal.TokenImpersonationLevel * AsyncCallback * obj -> IAsyncResult
Public Overridable Function BeginAuthenticateAsClient (credential As NetworkCredential, binding As ChannelBinding, targetName As String, requiredProtectionLevel As ProtectionLevel, allowedImpersonationLevel As TokenImpersonationLevel, asyncCallback As AsyncCallback, asyncState As Object) As IAsyncResult

매개 변수

credential
NetworkCredential

클라이언트의 ID를 설정하는 데 사용되는 NetworkCredential입니다.

binding
ChannelBinding

확장 보호에 사용되는 ChannelBinding입니다.

targetName
String

인증할 서버를 고유하게 식별하는 SPN(서비스 사용자 이름)입니다.

requiredProtectionLevel
ProtectionLevel

스트림의 보안 서비스를 나타내는 ProtectionLevel 값 중 하나입니다.

allowedImpersonationLevel
TokenImpersonationLevel

서버에서 클라이언트의 자격 증명을 사용하여 리소스에 액세스하는 방법을 나타내는 TokenImpersonationLevel 값 중 하나입니다.

asyncCallback
AsyncCallback

인증이 완료되었을 때 호출할 매서드를 참조하는 AsyncCallback 대리자입니다.

asyncState
Object

쓰기 작업에 대한 정보가 포함된 사용자 정의 개체입니다. 작업이 완료되면 asyncCallback 대리자에게 전달되는 개체입니다.

반환

비동기 작업의 상태를 표시하는 IAsyncResult 개체입니다.

예외

credentialnull입니다.

또는

targetName이(가) null인 경우

인증이 실패한 경우. 이 개체를 사용하여 인증을 다시 시도할 수 있습니다.

인증이 실패한 경우. 이 개체를 사용하여 인증을 다시 시도할 수 있습니다.

인증이 이미 발생한 경우.

또는

이전에 이 스트림을 사용하여 서버로 인증을 시도한 경우. 해당 스트림을 사용하여 클라이언트로 인증을 다시 시도할 수는 없습니다.

이 개체가 닫힌 경우.

설명

매개 변수를 requiredProtectionLevel 사용하여 인증된 스트림을 사용하여 전송되는 데이터에 대한 보안 서비스를 요청합니다. 예를 들어 데이터를 암호화하고 서명하려면 값을 지정합니다 EncryptAndSign . 인증에 성공했다고 해서 요청 ProtectionLevel 된 가 부여되었음을 보장하지는 않습니다. 및 IsSigned 속성을 검사 IsEncrypted 에서 사용되는 NegotiateStream보안 서비스를 결정해야 합니다.

이 메서드는 비동기이며 작업이 완료되는 동안 차단되지 않습니다. 작업이 완료될 때까지 차단하려면 메서드 오버로드 중 AuthenticateAsClient 하나를 사용합니다.

메서드를 호출 EndAuthenticateAsClient 하여 비동기 인증 작업을 완료해야 합니다. 일반적으로 메서드는 대리자에서 호출됩니다 asyncCallback . 비동기 프로그래밍 모델 사용에 대한 자세한 내용은 동기 메서드 비동기 호출을 참조하세요.

인증에 실패하면 또는 가 AuthenticationExceptionInvalidCredentialException수신됩니다. 이 경우 다른 자격 증명을 사용하여 인증을 다시 시도할 수 있습니다.

추가 정보

적용 대상