[jboss-user] [Security & JAAS/JBoss] - Re: looking for working example: custom login module extends

rsanka do-not-reply at jboss.com
Wed Mar 5 13:38:42 EST 2008


Ragav: Are you able to get ejbContext.getCallerPrincipal to return your CustomPrincipal ? 

For example:

@Stateless
  | public class MyStatelessBean implements IMyStatelessBean 
  | {
  |    @Resource
  |    SessionContext ejbContext;
  | 	
  |    public void testMethod()
  |    {
  |       MyCustomPrincipal principal = (MyCustomPrincipal) ejbContext.getCallerPrincipal();
  |       //I get a class cast exception here
  |    }
  | }
My login-config.xml does specify a principalClass module-option to my CustomLoginModule. 

Interestingly though - in a servlet - request.getUserPrincipal() returns the correct MyCustomPrincipal as expected.

Thanks

Ramakrishna

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

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



More information about the jboss-user mailing list