my dog learned polymorphism*
The moose likes JBoss/WildFly and the fly likes Accessing groups in a session bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Accessing groups in a session bean" Watch "Accessing groups in a session bean" New topic
Author

Accessing groups in a session bean

Sebastiaan Kortleven
Ranch Hand

Joined: Mar 12, 2004
Posts: 81
Hi there,
So I created my own little LoginModule, based on the DatabaseServerLoginModule supplied by JBoss. All works fine and the login succeeds and fails where expected.
In the loginmodule I add several groups of principals to the subject.
I have a group called Roles, and 3 other groups.
I only use the Roles group to make sure the user logs in. Our security system is based on Siebel, where they use Positions and Responsibilities, so I add these groups and fill them accordingly.
Now, in a bean I can access the context and ask for the CallerPrincipal, doing a getName() on that principal gives me the username. But how can I access the groups I created in the loginmodule? (I need those for some application specific security handling)
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 367
You don't enumerate the groups, you ask if the person is in the group/role:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing groups in a session bean
 
Similar Threads
Using default JAAS Mechanism in Websphere makes applications to access the context path of the other
Migrating JAAS from JBoss to Websphere 6.1
java.lang.SecurityException: Authentication exception, principal=null
programiccally map user roles
J2EE security through entire enterprise app