My application is protected with a UsersRolesLoginModule in a sec domain 
specified in my jboss.xml and jboss-web.xml.  When I run the app I am properly 
forms-based challenged, authenticated and on my merry way.  

Until, I do anything that involves JBoss invoking my JMS queue listener.  At 
this point my listener class tries to create the home interface of a bean that 
is specified in my method-permission in the descriptor as being protected by 
this security domain.   JBoss throws:

Authentication exception, principal=null

I tried to get around this by putting the following in my listener right before 
the call that is causing this to be thrown.  I implemented MyCallbackHandler of 
course:

  LoginContext lc = null;
  Subject subj = null;
  String foo = null;
                
  try
 {
        CallbackHandler ch = new MyCallbackHandler();
        lc = new LoginContext("java:/jaas/mySecDomain",ch);
        lc.login();
        subj = lc.getSubject();
         foo = subj.toString();
}
 catch (LoginException le)
{
   le.printStackTrace();
}

    return myBeanNameHome.create();

The line return myBeanNameHome.create(); throws the exception.  The lc.login 
returns successfully and the Subject obtained is properly populated with the 
roles that it could only get via going through the UsersRolesLoginModule in 
mySecDomain.

Yet even though this JAAS principal is established here right before this call 
when it tries to invoke this call to create the home interface it fails with 
principal = null.

What am I missing?

John

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

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


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to