AuthenticationSchemes 열거형

정의

인증에 사용할 프로토콜을 지정합니다.

이 열거형은 멤버 값의 비트 조합을 지원합니다.

public enum class AuthenticationSchemes
[System.Flags]
public enum AuthenticationSchemes
[<System.Flags>]
type AuthenticationSchemes = 
Public Enum AuthenticationSchemes
상속
AuthenticationSchemes
특성

필드

Anonymous 32768

익명 인증을 지정합니다.

Basic 8

기본 인증을 지정합니다.

Digest 1

다이제스트 인증을 지정합니다.

IntegratedWindowsAuthentication 6

Windows 인증을 지정합니다.

Negotiate 2

클라이언트와 협상하여 인증 체계를 결정합니다. 클라이언트와 서버 모두 Kerberos를 지원하면 이 인증 체계가 사용되고, 그렇지 않으면 NTLM이 사용됩니다.

None 0

인증이 허용되지 않습니다. 이 플래그가 설정된 상태에서 HttpListener 개체를 요청하는 클라이언트는 항상 403 Forbidden 상태를 받게 됩니다. 이 플래그는 리소스를 클라이언트에 제공하지 않아야 하는 경우에 사용합니다.

Ntlm 4

NTLM 인증을 지정합니다.

예제

다음 코드 예제에서는 Negotiate 열거형 값을 사용하여 클라이언트가 Negotiate 보안 프로토콜을 사용하여 인증되도록 지정하는 방법을 보여 줍니다.

Console.WriteLine("Listening for {0} prefixes...", listener.Prefixes.Count);
HttpListenerContext context = listener.GetContext();
HttpListenerRequest request = context.Request;
Console.WriteLine("Received a request.");
// This server requires a valid client certificate
// for requests that are not sent from the local computer.

// Did the client omit the certificate or send an invalid certificate?
if (request.IsAuthenticated &&
    request.GetClientCertificate() == null ||
    request.ClientCertificateError != 0)
{
    // Send a 403 response.
    HttpListenerResponse badCertificateResponse = context.Response ;
    SendBadCertificateResponse(badCertificateResponse);
    Console.WriteLine("Client has invalid certificate.");
    continue;
}
Console.WriteLine("Listening for {0} prefixes...", listener.Prefixes.Count)
Dim context As HttpListenerContext = listener.GetContext()
Dim request As HttpListenerRequest = context.Request
Console.WriteLine("Received a request.")
' This server requires a valid client certificate
' for requests that are not sent from the local computer.

' Did the client omit the certificate or send an invalid certificate?
If request.IsAuthenticated AndAlso request.GetClientCertificate() Is Nothing OrElse request.ClientCertificateError <> 0 Then
    ' Send a 403 response.
    Dim badCertificateResponse As HttpListenerResponse = context.Response
    SendBadCertificateResponse(badCertificateResponse)
    Console.WriteLine("Client has invalid certificate.")
    Continue Do
End If

설명

이 열거형은 개체에서 처리 HttpListener 중인 클라이언트 요청을 인증하는 데 사용되는 메서드를 지정하는 데 사용됩니다.

중요

기본 인증에는 암호 교환이 필요하므로 암호화된 보안 연결의 경우를 제외하고는 피해야 합니다.

기본 및 다이제스트 인증에 대한 자세한 내용은 RFC2617 - HTTP 인증: 기본 및 다이제스트 인증을 참조하세요. 이 문서는 .에서 https://www.rfc-editor.org사용할 수 있습니다.

적용 대상