AuthenticationSchemes Sabit listesi
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
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
- Öznitelikler
Alanlar
| Name | Değer | Description |
|---|---|---|
| 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. |
| Digest | 1 | Özet kimlik doğrulamayı belirtir. |
| Negotiate | 2 | Kimlik doğrulama düzenini belirlemek için istemciyle anlaşma sağlar. hem istemci hem de sunucu Kerberos'ı destekliyorsa kullanılır; aksi takdirde NTLM kullanılır. |
| Ntlm | 4 | NTLM kimlik doğrulamayı belirtir. |
| IntegratedWindowsAuthentication | 6 | Windows kimlik doğrulamayı belirtir. |
| Basic | 8 | Temel kimlik doğrulamayı belirtir. |
| Anonymous | 32768 | Anonim kimlik doğrulamayı belirtir. |
Örnekler
Aşağıdaki kod örneği, anlaşma güvenlik protokolü kullanılarak istemcilerin kimliğinin 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.
Important
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.