-
1. Re: Using SecurityClient
wolfgangknauf Jun 8, 2009 9:56 AM (in response to rbattenfeld)Hi Ralf,
take a look at this thread, second post:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=144865
It show a sample how to perform a JAAS login without the SecurityClient.
Hope this helps
Wolfgang -
2. Re: Using SecurityClient
anil.saldhana Jun 8, 2009 12:07 PM (in response to rbattenfeld)SecurityClient class was added to provide simplified login capabilities on the client side. Many users find JAAS based login pretty cumbersome. For such users, there is no easy way of specifying a simple username,pwd combination in a standard way. SC helps them.
-
3. Re: Using SecurityClient
rbattenfeld Jun 9, 2009 9:48 AM (in response to rbattenfeld)Hi Wolfgang and Anil
Thank you for your replies. I changed the client login as mentioned in the thread:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=144865]
Unfortunately, it didn't solve the problem. May the problem is related to how my custom login module passes the roles back to the JAAS framework. According this blog:
http://stuffthathappens.com/blog/2008/05/16/writing-a-custom-jaas-loginmodule/]
the way of passing roles are JBoss specific. May I have to pass it differently when using standard JAAS client login without the SecurityClient.
The code is:if (!subject.getPrincipals().contains(user)) { subject.getPrincipals().add(user); /** * this is the important part to work with JBoss: * jboss requires the name 'Roles' */ SimpleGroup group = new SimpleGroup("Roles"); for (SimplePrincipal role : roles) { group.addMember(role); } subject.getPrincipals().add(group); }
The login itself works fine. The security exception is thrown when the client invokes a method from the session bean.
Regards,
Ralf -
4. Re: Using SecurityClient
anil.saldhana Jun 9, 2009 12:30 PM (in response to rbattenfeld)On the client side (not running in JBoss), you cannot do any role changes etc. All you do is pass the username/password combo across to the server.
-
5. Re: Using SecurityClient
rbattenfeld Jun 9, 2009 1:49 PM (in response to rbattenfeld)Yes, I am aware of it. May I was not precise enough. Everything works fine except that the roles are not propagated to the EJB module. The code I added in the previous message is a snippet from the custom login module running in JBoss. Again, it works with using SecurityClient and works not when using standard JAAS client login.