Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Konfiguriert die ASP.NET-Authentifizierung.
Syntax
class AuthenticationSection : ConfigurationSectionWithCollection
Methoden
In der folgenden Tabelle werden die Methoden aufgelistet, die von der AuthenticationSection-Klasse verfügbar gemacht werden.
| Name | Beschreibung |
|---|---|
| Add (Hinzufügen) | (Geerbt von ConfigurationSectionWithCollection.) |
| Clear | (Geerbt von ConfigurationSectionWithCollection.) |
| Get | (Geerbt von ConfigurationSectionWithCollection.) |
| GetAllowDefinition | (Geerbt von ConfigurationSection.) |
| GetAllowLocation | (Geerbt von ConfigurationSection.) |
| Remove | (Geerbt von ConfigurationSectionWithCollection.) |
| RevertToParent | (Geerbt von ConfigurationSection.) |
| SetAllowDefinition | (Geerbt von ConfigurationSection.) |
| SetAllowLocation | (Geerbt von ConfigurationSection.) |
Eigenschaften
In der folgenden Tabelle sind die Eigenschaften aufgeführt, die von der AuthenticationSection-Klasse verfügbar gemacht werden.
| Name | Beschreibung |
|---|---|
Forms |
Ein FormsAuthenticationConfiguration-Wert, der die Formularauthentifizierung für die Webanwendung konfiguriert. |
Location |
(Geerbt von ConfigurationSection.) Eine Schlüsseleigenschaft. |
Mode |
Ein Lese-/Schreibwert sint32, der den Authentifizierungsmodus für die Webanwendung angibt. Die möglichen Werte werden weiter unten im Abschnitt Hinweise aufgeführt. |
Passport |
Ein PassportAuthentication-Wert, der eine URL enthält, an die die Authentifizierungsanforderung umgeleitet wird. |
Path |
(Geerbt von ConfigurationSection.) Eine Schlüsseleigenschaft. |
SectionInformation |
(Geerbt von ConfigurationSection.) |
Unterklassen
Diese Klasse enthält keine Unterklassen.
Hinweise
In der folgenden Tabelle werden die verschiedenen möglichen Werte für die Mode-Eigenschaft angezeigt. Der Standardwert ist 1 (Windows).
| Wert | Schlüsselwort | Beschreibung |
|---|---|---|
| 0 | None |
Gibt keine Authentifizierung an. |
| 1 | Windows |
Gibt Windows als Authentifizierungsmodus an. Dieser Modus gilt, wenn ASP.NET die Authentifizierungsmethoden Basic, Digest, Integrated Windows (NTLM/Kerberos) oder Clientzertifikatzuordnung verwendet. |
| 2 | Passport |
Gibt die Microsoft Passport-Netzwerkauthentifizierung als Authentifizierungsmodus an. |
| 3 | Forms |
Gibt die ASP.NET Forms-Authentifizierung als Authentifizierungsmodus an. |
Beispiel
Im folgenden Beispiel wird der Authentifizierungsmodus für die Standardwebsite angezeigt. Wenn der Authentifizierungsmodus Passportist, wird die Umleitungs-URL angezeigt. Wenn der Modus Forms ist, werden die entsprechenden Informationen angezeigt.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = _
GetObject("winmgmts:root\WebAdministration")
' Get the authentication section.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "AuthenticationSection", oAuthSection
' Display the path and location.
WScript.Echo "Path: " & oAuthSection.Path
WScript.Echo "Location: " & oAuthSection.Location
WScript.Echo
' Get the authentication mode and display it in text.
strAuthMode = ModeText(oAuthSection.Mode)
WScript.Echo "Authentication Mode: " & _
"[ " & strAuthMode & " ]"
' If the mode is Passport or Forms, display the
' additional information.
If strAuthMode = "Passport" Then
WScript.Echo "Passport URL: " & "[" & _
oAuthSection.Passport.RedirectUrl & "]"
ElseIf strAuthMode = "Forms" then
DisplayFormsAuthSettings(oAuthSection.Forms)
End If
' Convert the Mode enumeration values to text.
Function ModeText(enumValue)
Select Case enumValue
Case 0
ModeText = "None"
Case 1
ModeText = "Windows"
Case 2
ModeText = "Passport"
Case 3
ModeText = "Forms"
Case Else
ModeText = "Undefined enumeration value."
End Select
End Function
' Display the Forms authentication settings.
Sub DisplayFormsAuthSettings(oFormsAuthConfig)
WScript.Echo vbCrLf & "Forms Authentication Settings"
WScript.Echo "-----------------------------"
WScript.Echo "Cookieless: [ " & _
CookielessText(oFormsAuthConfig.Cookieless) & " ]"
WScript.Echo "Default Url: [ " & _
oFormsAuthConfig.DefaultUrl & " ]"
WScript.Echo "Domain: [ " & _
oFormsAuthConfig.Domain & " ]"
WScript.Echo "EnableCrossAppRedirects: [" & _
oFormsAuthConfig.EnableCrossAppRedirects & " ]"
WScript.Echo "LoginUrl: [ " & _
oFormsAuthConfig.LoginUrl & " ]"
WScript.Echo "Name: [ " & _
oFormsAuthConfig.Name & " ]"
WScript.Echo "Path: [ " & _
oFormsAuthConfig.Path & " ]"
WScript.Echo "Protection: [ " & _
ProtectionText(oFormsAuthConfig.Protection) & " ]"
WScript.Echo "RequireSSL: [ " & _
oFormsAuthConfig.RequireSSL & " ]"
WScript.Echo "SlidingExpiration: [ " & _
oFormsAuthConfig.SlidingExpiration & " ]"
WScript.Echo "Timeout: [ " & _
oFormsAuthConfig.Timeout & " ]"
DisplayCredentials(oFormsAuthConfig.Credentials)
End Sub
' Convert the Cookieless enumeration values to text.
Function CookielessText(enumValue)
Select Case enumValue
Case 0
CookielessText = "UseUri"
Case 1
CookielessText = "UseCookies"
Case 2
CookielessText = "AutoDetect"
Case 3
CookielessText = "UseDeviceProfile"
Case Else
CookielessText = "Undefined enumeration value."
End Select
End Function
' Convert the Protection enumeration values to text.
Function ProtectionText(enumValue)
Select Case enumValue
Case 0
ProtectionText = "All"
Case 1
ProtectionText = "None"
Case 2
ProtectionText = "Encryption"
Case 3
ProtectionText = "Validation"
Case Else
ProtectionText = "Undefined enumeration value."
End Select
End Function
' Display the Forms authentication credentials.
Sub DisplayCredentials(FA_Credentials)
WScript.Echo vbCrLf & "Forms Authentication Credentials"
WScript.Echo "--------------------------------"
WScript.Echo "Password Format: " & _
PwdFormatText(FA_Credentials.PasswordFormat) & VbCrLf
For Each FormsAuthUser In FA_Credentials.Credentials
WScript.Echo " Name: [ " & FormsAuthUser.Name & " ]"
WScript.Echo "Password: [ " & _
FormsAuthUser.Password& " ]"
WScript.Echo
Next
End Sub
' Convert the PasswordFormat enumeration values to text.
Function PwdFormatText(enumValue)
Select Case enumValue
Case 0
PwdFormatText = "Clear"
Case 1
PwdFormatText = "SHA1"
Case 2
PwdFormatText = "MD5"
Case Else
PwdFormatText = "Undefined enumeration value."
End Select
End Function
Vererbungshierarchie
ConfigurationSectionWithCollection
AuthenticationSection
Anforderungen
| type | Beschreibung |
|---|---|
| Client | IIS 7.0 unter Windows Vista IIS 7.5 unter Windows 7 IIS 8.0 unter Windows 8 IIS 10.0 unter Windows 10 |
| Server | IIS 7.0 unter Windows Server 2008 - IIS 7.5 unter Windows Server 2008 R2 IIS 8.0 auf Windows Server 2012 - IIS 8.5 unter Windows Server 2012 R2 IIS 10.0 auf Windows Server 2016 |
| Produkt | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
| MOF-Datei | WebAdministration.mof |
Weitere Informationen
AnonymousAuthenticationSection-Klasse
BasicAuthenticationSection-Klasse
ClientCertificateMappingAuthenticationSection-Klasse
ConfigurationSectionWithCollection-Klasse
DigestAuthenticationSection-Klasse
FormsAuthenticationConfiguration-Klasse
FormsAuthenticationCredentials-Klasse
FormsAuthenticationUser-Klasse
IisClientCertificateMappingAuthenticationSection-Klasse
PassportAuthentication-Klasse
WindowsAuthenticationSection-Klasse