Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DefaultServiceNames Property

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)

Public ReadOnly Property DefaultServiceNames As ServiceNameCollection
Dim instance As HttpListener 
Dim value As ServiceNameCollection 

value = instance.DefaultServiceNames

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.

Windows 7, Windows Server 2008 R2

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

.NET Framework

Supported in: 3.5 SP1

Community Additions

© 2015 Microsoft