我完全不熟悉容器託管安全性,需要一些幫助來在我的Web應用程序中對其進行配置。適用於Web應用程序的容器託管安全
我想在我的web應用程序中限制對jsp的訪問。這是我如何在我的web.xml中配置安全
<security-constraint>
<display-name>PrivilegedConstraint</display-name>
<web-resource-collection>
<web-resource-name>JSP Files</web-resource-name>
<description>All the jsp files in the web application</description>
<url-pattern>*.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>PrivilegedRole</role-name>
</auth-constraint>
<user-data-constraint>
<description/>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>BasicRealm</realm-name>
</login-config>
<security-role>
<description>This is a privileged role. Has access to everything in the web app</description>
<role-name>PrivilegedRole</role-name>
</security-role>
我的問題是:
什麼是境界名在login-config元素的目的是什麼? 我在哪裏配置用戶名,密碼並將用戶映射到角色?
當我嘗試訪問我的web應用程序中的jsp時,我被要求輸入用戶名和密碼。我在那裏給了什麼?這個安全機制是如何工作的?
我對安全性很陌生,所以我會很感激,如果有人能指出我一篇很好的文章,解釋配置安全性的基礎知識以及它的實際工作原理?