HttpListener.DefaultServiceNames Property

Gets a default list of Service Provider Names (SPNs) as determined by registered prefixes.

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

member DefaultServiceNames : ServiceNameCollection with get

The DefaultServiceNames property is used with integrated Windows authentication to provide extended protection. The list of SPNs is initialized from the Prefixes property when accessed and cleared when new prefixes are added to the Prefixes property.

The DefaultServiceNames property is used if an application doesn't set the CustomServiceNames property on its extended protection policy.

The ServiceNameCollection that is retrieved with the DefaultServiceNames property is built from the Prefixes property according to the following rules:

  1. If the hostname is "+", "*", or an IPv4 or IPv6 literal (equivalent to "*" but restricted to a specific local interface), the following SPN is added:

"HTTP/" plus the fully qualified domain name of the computer.

  1. If the hostname contains no dots (no domains or subdomains), an attempt is made to resolve the fully-qualified domain name using DNS (the same behavior used by HttpWebRequest). If the fully-qualified domain name can be resolved, the following SPNs are added:

"HTTP/" plus the hostname (the short name).

"HTTP/" plus the fully qualified domain name for the hostname.

  1. If the hostname contains not dots (no domains or subdomains) and a fully-qualified domain name can't be resolved, the following SPN is added:

"HTTP/" plus the hostname.

  1. If the hostname contains dots (domains or subdomains), the following SPN is added:

"HTTP/" plus the hostname.

The DefaultServiceNames property can be used by an application to review the list of default SPNs which will be used for authentication if no custom list is supplied. If other SPNs are needed, an application can add them using one of the Merge methods.

It is not safe when using extended protection to make policy decisions based on the requested URL, since this can be spoofed. Rather, applications should rely on the LocalEndPoint or RemoteEndPoint properties to make such policy decisions.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft