Could you please explain how you set up Username Token Authentication. In which file does this XML go ?
Thanks this worked. Added the xml file below to my EJB3 jar file resolved my problem.
<?xml version="1.0" encoding="UTF-8"?> <jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd"> <config> <username/> </config> </jboss-ws-security>
I have specified the loginModule to use via @SecurityDomain(value="THZone") in my bean. I have also configured the login module in login-config.xml as shown below. I am not able to log in and authenticate, but the roles are not passed through. Where can I configure how the roles are obtained.
System.out.println("Principal is a friend :"+context.isUserInRole("friends"));
Currently don't seem to work. I also tried to implement my own login module return my own implementations of Principal and had the same problem as using the org.jboss.security.auth.spi.UsersRolesLoginModule on. The results are that the principal is passed through and accessible through the context, but the roles are not.