I am completely new to Container managed security and need some help with configuring it in my web application.
I want to restrict access to the jsp's within my web application. This is how i have configured security in my 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>
My questions are :
What is the purpose of realm-name in the login-config element? Where do i configure the username, passwords and map the users to the roles?
When i try to access a jsp within my web application, i get asked for a username and password. What do i give there? And how does this security mechanism work?
I am completely new to security, so I will be grateful if someone can point me to a nice article which explains the basics of configuring security and how it actually works?