I wanted to post an interesting observation. I have a custom LoginModule 
implementation that I was using. In the login module I was not using the 
SimplePrincipal and the SimpleGroups implementations provided by JBoss. I was 
using custom implementation of the java.security.Principal and 
java.security.acl.Group interfaces.

This seems to work fine for authentication of the web side but seemed to fail 
for the EJB. Both the web and EJBs were secured using the same domain that used 
my custom login module.

See http://www.jboss.org/index.html?module=bb&op=viewtopic&t=67345 for my prior 
post.

When I did a small walk through of the JBoss source code (thank heavens its 
open source) I found that on the web container side, the roles are checked by 
getting the individual principals out of the Group as Strings (using the 
members() method first on the group and then the getName() on each Principal in 
the enumeration). Basically the security interceptor gets all the roles the 
user belongs to as strings and then  checks to see if the desired role is 
present or not.

However, on the EJB side of things, the security interceptor directly calls the 
isMember() method on the Group named "Roles" found in the Subject. The argument 
passed to the isMember() method is of type org.jboss.security.SimplePrincipal. 
I was directly checking this against the Principals in my group. However, since 
the class of my principals were different the == was not working and I was 
getting SecurityExceptions thrown back during the EJB calls.

I understand that my impl of the isMember() method can be seen as flawed but 
why does JBoss have to have confilicting mechanisms to check roles on the Web 
and EJB fronts? 

Any thoughts?

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3888147#3888147

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3888147


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to