• Post Reply Bookmark Topic Watch Topic
  • New Topic

secutity-constraint web.xml  RSS feed

 
Isaias C. Barroso
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I need to make the follow security configuration using BASIC Auth:
/jsp/test.jsp -> role "employee"
/jsp/test1.jsp -> role "manager"
How to make this on web.xml?
Best Regards,
 
Thomas Hubschman
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isais,
Here is a sample of a sucessful web.xml sercurity constraint. There is specific info in the web-app DTD located at http://java.sun.com/dtd/web-app_2_3.dtd

<security-constraint>

<display-name>
Jobs Web Application Security
</display-name>

<web-resource-collection>
<web-resource-name>
Secure Jobs Web Application Area
</web-resource-name>
<url-pattern>
/ManageJobsServlet
</url-pattern>
<url-pattern>
/ManageJob.jsp
</url-pattern>
<url-pattern>
/NewJobServlet
</url-pattern>
<url-pattern>
/NewJob.jsp
</url-pattern>
<url-pattern>
/EditJobServlet
</url-pattern>
<url-pattern>
/EditJob.jsp
</url-pattern>
<url-pattern>
/DeleteJobServlet
</url-pattern>
<url-pattern>
/ReplaceJobServlet
</url-pattern>
</web-resource-collection>

<auth-constraint>
<role-name>
hiringmanager
</role-name>
</auth-constraint>

</security-constraint>
<login-config>

<auth-method>
BASIC
</auth-method>

<realm-name>
Secure Jobs Web Application Realm
</realm-name>

</login-config>


<security-role>
<role-name>
hiringmanager
</role-name>
</security-role>

Hope this helps.
[ December 07, 2002: Message edited by: Thomas Hubschman ]
 
Isaias C. Barroso
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
Best regards.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!