• Post Reply Bookmark Topic Watch Topic
  • New Topic

role  RSS feed

 
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
Posts: 3993
31
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!