Hi,

I have developped a stateful session bean where access to methods are
restricted :

 

@SecurityDomain("myDomainBlabla")
@RolesAllowed({"xxx", "yyy"})
@Stateful
public class BlablaBean  implements BlablaRemote {


          @RolesAllowed({"xxx"})
            public void doSomething(User user) {
            ...
            }
            ...
}

 

Authentication and authorization worls well from a JUnit test case.
Inside my JUnit class, I perform a connection :

 

          SecurityClient securityClient =
SecurityClientFactory.getSecurityClient();           
            securityClient.setSimple("user1", "pwd1");           
            securityClient.login();

No problem. The user with role xxx gets access to the method
doSomething(User user)
according to the files myApp-users.properties and myApp-roles.properties

 

I am now trying to authenticate the user in a Struts 2 action
(LoginAction) and propagate the role, using the same code :


            SecurityClient securityClient =
SecurityClientFactory.getSecurityClient();           
            securityClient.setSimple("user1", "pwd1");           
            securityClient.login();            
           
It does not work, i get an error when i try to access the method
doSomething(User user) :

 

11:22:44,456 ERROR [STDERR] javax.ejb.EJBAccessException: Invalid User

 

What is wrong ? I am guessing i need to propagate the role to the entire
app, how do i do that ?

 

Thanks for helping

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to