安全和授權限制在沒有登錄配置的情況下會失敗。
<login-config> 元素用于配置用戶對應用程序進行驗證的方式。缺少 authentication 方法意味著應用程序不知道如何應用授權限制,因為無人可以登錄。authentication 方法使用 <auth-method> 標簽指定,該標簽是 <login-config> 的子標簽。
共有四種 authentication 方法:BASIC、FORM、DIGEST 和 CLIENT_CERT。BASIC 代表 HTTP Basic authentication。FORM 代表基于表單的 authentication。DIGEST 和 BASIC authentication 相似;但是,DIGEST 中的密碼已加密。CLIENT_CERT 要求客戶端有公鑰證書并使用 SSL/TLS。
例 1:以下配置未指定登錄配置。
<web-app>
<!-- servlet declarations -->
<servlet>...</servlet>
<!-- servlet mappings-->
<servlet-mapping>...</servlet-mapping>
<!-- security-constraints-->
<security-constraint>...</security-constraint>
<!-- login-config goes here -->
<!-- security-roles -->
<security-role>...</security-role>
</web-app>
[1] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A9 Application Denial of Service
[2] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP6080 CAT II
[3] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP6080 CAT II
[4] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 730
[5] Standards Mapping - FIPS200 - (FISMA) IA
[6] Sun Microsystems, Inc. Java Servlet Specification 2.4
[7] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.9
[8] Sun Microsystems, Inc. Specifying an Authentication Mechanism