1.Http Authentication:
%tomcat%/conf/tomcat-users.xml: <tomcat-users> <user name=" " password=". " roles="." /><tomcat-users>
web.xml: <security-constraint> <web-resource-collection> <web-resource-name>.</web-resource-name><usr-pattern>..</url-pattern><http-method>.</http-method> <</web-resource-collection> <auch-constraint> <role-name> ... </role-name></auth-constraint></security-constraint> <login-config><auth-method> basic</auth-method> <realm-name> ... </realm-name> </login-config> <security-role> <role-name> ... </role-name></security-role>
2.Form-Based Authentication
<auth-method> form </auth-method>
<form-login-config> <form-login-page>...</form-login-page> <form-error-page> .. </form-error-page></form-login-config>
3.Custom Authentication:<auth-method> </auth-method>
4.Form-Based Custom Authentication: <auth-method> </auth-method>
5.SSL: <user-data-constraint> <transport-guarantee> CONFIDENTIAL </transport-guarantee> </user-data-constraint>
本文详细介绍了Apache Tomcat中五种主要的认证方式:HTTP基本认证、基于表单的认证、自定义认证、基于表单的自定义认证及SSL认证。通过具体的配置示例展示了如何在web.xml文件中设置这些认证方法。
2015

被折叠的 条评论
为什么被折叠?



