Hi rp28,
I have the same problem with a MDB, that calls various secured session beans. These
session are configured with <use-caller-identity/>.
The MDB has no security identity due to asynchronous communication. I have tried using
<run-as><role-name> with the MDB, but an AuthenticationException, principal=null is
thrown.
So I have tried to solve this problem with the code snippet you had written to get a
security identity that can be passed to the session beans.
The code snippet from the onMessage method of my MDB (JBoss 3.2.3 w/ Tomcat):
| CallbackHandler callbackHandler = new UsernamePasswordHandler(username, password);
| LoginContext lc = new LoginContext("test", callbackHandler);
| lc.login();
| Subject subject = lc.getSubject();
| Subject.doAs(subject, new PrivilegedAction() {
| public Object run() {
|
| MySessionLocalHome home = [getHome];
| MySession mySession = home.create();
| return null;
| }
| });
| mySession.callSomeMethods();
|
In login-config.xml I configured my <application-policy> with
DatabaseServerLoginModule which works fine as long as I don't use MDBs.
Though I get an AuthenticationException, principal=null.
Any ideas? Have I forgotten to configure something? Any help would be appreciated.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3834615#3834615
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3834615
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user