AuthenticationSchemes Sabit listesi

Tanım

Kimlik doğrulaması için protokolleri belirtir.

Bu sabit listesi, üyeleri için bit düzeyinde karşılaştırmayı destekler.

public enum class AuthenticationSchemes
[System.Flags]
public enum AuthenticationSchemes
[<System.Flags>]
type AuthenticationSchemes = 
Public Enum AuthenticationSchemes
Devralma
AuthenticationSchemes
Öznitelikler

Alanlar

Anonymous 32768

Anonim kimlik doğrulamayı belirtir.

Basic 8

Temel kimlik doğrulamayı belirtir.

Digest 1

Özet kimlik doğrulamayı belirtir.

IntegratedWindowsAuthentication 6

Windows kimlik doğrulamayı belirtir.

Negotiate 2

Kimlik doğrulama düzenini belirlemek için istemciyle anlaşmalar. Hem istemci hem de sunucu Kerberos'u destekliyorsa kullanılır; aksi takdirde, NTLM kullanılır.

None 0

Kimlik doğrulamasına izin verilmez. Bu bayrak kümesine sahip bir nesne isteyen bir HttpListener istemci her zaman 403 Yasak durumu alır. Bir kaynağın hiçbir zaman istemciye sunulmaması gerektiğinde bu bayrağı kullanın.

Ntlm 4

NTLM kimlik doğrulamayı belirtir.

Örnekler

Aşağıdaki kod örneği, istemcilerin Negotiate güvenlik protokolü kullanılarak kimliklerinin doğrulandığını belirtmek için Negotiate sabit listesi değerinin kullanılmasını gösterir.

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

Açıklamalar

Bu numaralandırma, nesneler tarafından HttpListener işlenen istemci isteklerinin kimliğini doğrulamak için kullanılan yöntemi belirtmek için kullanılır.

Önemli

Temel kimlik doğrulaması için parola değişimi gerekir ve bu nedenle güvenli, şifreli bağlantılar dışında kaçınılmalıdır.

Temel ve özet kimlik doğrulaması hakkında ek bilgi için bkz. RFC2617 - HTTP Kimlik Doğrulaması: Temel ve Özet Kimlik Doğrulaması. Bu belge adresinde https://www.rfc-editor.orgbulunabilir.

Şunlara uygulanır