• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

role

 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpServletRequest has a method "isUserInRole(String role)", in order for this to return "true", should you define this "role in web.xml or LDAP ? If it is defined in LDAP server, is it required to define it in web.xml as well ?
 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raj Ohadi wrote:HttpServletRequest has a method "isUserInRole(String role)", in order for this to return "true", should you define this "role in web.xml or LDAP ? If it is defined in LDAP server, is it required to define it in web.xml as well ?

You should match the role(s) (which are defined in <security-role>) in web.xml using <role-link> (inside the particular servlet) sub element. This allows to match the programmatic roles in to the roles used by the deployer.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raj Ohadi wrote:HttpServletRequest has a method "isUserInRole(String role)", in order for this to return "true", should you define this "role in web.xml or LDAP ? If it is defined in LDAP server, is it required to define it in web.xml as well ?


The role is already defined in LDAP. You should map the existing role in LDAP to your principal using the security-role element.

Use role-link mentioned by Vijitha when you want to change the principal name but want to point to the same role in LDAP
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic