Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Configures Basic authentication.
Syntax
class BasicAuthenticationSection : ConfigurationSection
Methods
The following table lists the methods exposed by the BasicAuthenticationSection
class.
Name | Description |
---|---|
GetAllowDefinition | (Inherited from ConfigurationSection.) |
GetAllowLocation | (Inherited from ConfigurationSection .) |
RevertToParent | (Inherited from ConfigurationSection .) |
SetAllowDefinition | (Inherited from ConfigurationSection .) |
SetAllowLocation | (Inherited from ConfigurationSection .) |
Properties
The following table lists the properties exposed by the BasicAuthenticationSection
class.
Name | Description |
---|---|
DefaultLogonDomain |
A read/write string value that specifies the default domain that the server uses to authenticate users when the client does not specify a domain in the logon dialog box. |
Enabled |
A read/write boolean value. true if Basic authentication is enabled; otherwise, false . The default is false . |
Location |
(Inherited from ConfigurationSection .) A key property. |
LogonMethod |
A read/write sint32 enumeration that specifies the default logon method for a local user. The type of logon will determine whether the resulting token can also be used remotely. The possible values are listed later in the Remarks section. |
Path |
(Inherited from ConfigurationSection .) A key property. |
Realm |
A read/write string value that contains the name of the realm that is used by the client for credential caching. |
SectionInformation |
(Inherited from ConfigurationSection .) |
Subclasses
This class contains no subclasses.
Remarks
The following table contains the possible values for the LogonMethod
property. The default is 3 (ClearText
). For more information, see the LogonUserEx function.
Value | Keyword | Description |
---|---|---|
0 | Interactive |
This logon type is intended for users who will be interactively using the computer. |
1 | Batch |
This logon type is intended for batch servers, where processes may be executing on behalf of a user without their direct intervention. Credentials are not cached for this logon type. |
2 | Network |
This logon type is intended for high performance servers to authenticate plaintext passwords. Credentials are not cached for this logon type. |
3 | ClearText |
This logon type preserves the name and password in the authentication package, which allows the server to make connections to other network servers while impersonating the client. |
Example
The following example displays the BasicAuthenticationSection
configuration for the default Web site.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = _
GetObject("winmgmts:root\WebAdministration")
' Get the Basic authentication section for the default Web site.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "BasicAuthenticationSection", oBasicAuth
' Display the path and location.
WScript.Echo "Basic Authentication Settings"
WScript.Echo "-----------------------------"
WScript.Echo "Path: " & oBasicAuth.Path
WScript.Echo "Location: " & oBasicAuth.Location
WScript.Echo
' Display the Enabled, DefaultLogonDomain, Realm, and
' LogonMethod properties.
WScript.Echo "Enabled: " & _
"[" & oBasicAuth.Enabled & "]"
WScript.Echo "DefaultLogonDomain: " & _
"[" & oBasicAuth.DefaultLogonDomain & "]"
WScript.Echo "Realm: " & "[" & oBasicAuth.Realm & "]"
WScript.Echo "LogonMethod: " & _
"[" & GetLogonMethodText(oBasicAuth.LogonMethod) & "]"
' Translate the LogonMethod enumeration values to text.
Function GetLogonMethodText(LogonMethodValue)
Select Case LogonMethodValue
Case 0
GetLogonMethodText = "Interactive"
Case 1
GetLogonMethodText = "Batch"
Case 2
GetLogonMethodText = "Network"
Case 3
GetLogonMethodText = "ClearText"
Case Else
GetLogonMethodText = "Undefined enumeration."
End Select
End Function
Inheritance Hierarchy
BasicAuthenticationSection
Requirements
Type | Description |
---|---|
Client | - IIS 7.0 on Windows Vista - IIS 7.5 on Windows 7 - IIS 8.0 on Windows 8 - IIS 10.0 on Windows 10 |
Server | - IIS 7.0 on Windows Server 2008 - IIS 7.5 on Windows Server 2008 R2 - IIS 8.0 on Windows Server 2012 - IIS 8.5 on Windows Server 2012 R2 - IIS 10.0 on Windows Server 2016 |
Product | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
MOF file | WebAdministration.mof |
See Also
AnonymousAuthenticationSection Class
AuthenticationSection Class
ClientCertificateMappingAuthenticationSection Class
DigestAuthenticationSection Class
FormsAuthenticationConfiguration Class
FormsAuthenticationCredentials Class
FormsAuthenticationUser Class
IisClientCertificateMappingAuthenticationSection Class
PassportAuthentication Class
WindowsAuthenticationSection Class
LogonUserEx