AuthenticationSection Class1
ASP.NET 인증을 구성합니다.
구문
class AuthenticationSection : ConfigurationSectionWithCollection
메서드
다음 표에서는 클래스에 의해 노출되는 메서드를 나열합니다 AuthenticationSection
.
속성 | 설명 |
---|---|
추가 | ConfigurationSectionWithCollection에서 상속됩니다. |
지우기 | ConfigurationSectionWithCollection 에서 상속됩니다. |
가져오기 | ConfigurationSectionWithCollection 에서 상속됩니다. |
GetAllowDefinition | ( ConfigurationSection에서 상속됩니다.) |
GetAllowLocation | ConfigurationSection 에서 상속됩니다. |
제거 | ConfigurationSectionWithCollection 에서 상속됩니다. |
RevertToParent | ConfigurationSection 에서 상속됩니다. |
SetAllowDefinition | ConfigurationSection 에서 상속됩니다. |
SetAllowLocation | ConfigurationSection 에서 상속됩니다. |
속성
다음 표에서는 클래스에 의해 노출되는 속성을 나열합니다 AuthenticationSection
.
속성 | Description |
---|---|
Forms |
웹 애플리케이션 에 대한 Forms 인증을 구성하는 FormsAuthenticationConfiguration 값입니다. |
Location |
(에서 ConfigurationSection 상속됨) 키 속성입니다. |
Mode |
웹 애플리케이션의 인증 모드를 지정하는 읽기/쓰기 sint32 값입니다. 가능한 값은 설명 섹션의 뒷부분에 나와 있습니다. |
Passport |
인증 요청을 리디렉션할 URL을 포함하는 PassportAuthentication 값입니다. |
Path |
(에서 ConfigurationSection 상속됨) 키 속성입니다. |
SectionInformation |
ConfigurationSection 에서 상속됩니다. |
를 서브클래싱합니다.
이 클래스에는 서브클래스가 없습니다.
설명
다음 표에서는 속성에 사용할 수 있는 값을 나열합니다 Mode
. 기본값은 1(Windows
)입니다.
값 | 키워드 | Description |
---|---|---|
0 | None |
인증을 지정하지 않고 |
1 | Windows |
Windows를 인증 모드로 지정합니다. 이 모드는 ASP.NET Basic, Digest, Integrated Windows(NTLM/Kerberos) 또는 클라이언트 인증서 매핑 인증 방법을 사용하는 경우에 적용됩니다. |
2 | Passport |
Microsoft Passport Network 인증을 인증 모드로 지정합니다. |
3 | Forms |
ASP.NET Forms 인증을 인증 모드로 지정합니다. |
예제
다음 예제에서는 기본 웹 사이트에 대한 인증 모드를 표시합니다. 인증 모드가 이 Passport
면 리디렉션 URL이 표시됩니다. 모드가 이 Forms
면 해당 정보가 표시됩니다.
' 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
상속 계층 구조
ConfigurationSectionWithCollection
AuthenticationSection
요구 사항
형식 | Description |
---|---|
클라이언트 | - Windows Vista의 IIS 7.0 - Windows 7의 IIS 7.5 - Windows 8의 IIS 8.0 - WINDOWS 10 IIS 10.0 |
서버 | - Windows Server 2008의 IIS 7.0 - Windows Server 2008 R2의 IIS 7.5 - Windows Server 2012의 IIS 8.0 - Windows Server 2012 R2의 IIS 8.5 - WINDOWS SERVER 2016 IIS 10.0 |
제품 | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
MOF 파일 | WebAdministration.mof |
참고 항목
AnonymousAuthenticationSection 클래스
BasicAuthenticationSection 클래스
ClientCertificateMappingAuthenticationSection 클래스
ConfigurationSectionWithCollection 클래스
DigestAuthenticationSection 클래스
FormsAuthenticationConfiguration 클래스
FormsAuthenticationCredentials 클래스
FormsAuthenticationUser 클래스
IisClientCertificateMappingAuthenticationSection 클래스
PassportAuthentication 클래스
WindowsAuthenticationSection 클래스