AuthenticationSchemes Enumeration

Note: This enumeration is new in the .NET Framework version 2.0.

Specifies protocols for authentication.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace: System.Net
Assembly: System (in system.dll)

public enum class AuthenticationSchemes
/** @attribute FlagsAttribute() */ 
public enum AuthenticationSchemes
public enum AuthenticationSchemes

 Member nameDescription
AnonymousSpecifies anonymous authentication. 
BasicSpecifies basic authentication.  

For additional information, see RFC2617 – HTTP Authentication: Basic and Digest Authentication. This document is available at

DigestSpecifies digest authentication. 

For additional information, see RFC2617 – HTTP Authentication: Basic and Digest Authentication. This document is available at

IntegratedWindowsAuthenticationSpecifies Windows authentication. 
NegotiateNegotiates with the client to determine the authentication scheme. If both client and server support Kerberos, it is used; otherwise, NTLM is used. 
NoneNo authentication is allowed. A client requesting an HttpListener object with this flag set will always receive a 403 Forbidden status. Use this flag when a resource should never be served to a client. 
NtlmSpecifies NTLM authentication. 

This enumeration is used to specify the method used to authenticate client requests being processed by HttpListener objects.

Note   Basic authentication requires the exchange of a password and should therefore be avoided except in the case of secure, encrypted connections.

The following code example demonstrates using the Negotiate enumeration value to specify that clients are authenticated using the Negotiate security protocol.

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 ;
    Console.WriteLine("Client has invalid certificate.");

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0