users@glassfish.java.net

Accessing Secure EJB from another Container (Tomcat)

From: <glassfish_at_javadesktop.org>
Date: Thu, 26 Mar 2009 08:46:20 PDT

Hi,
I have deployed an EJB with the following sun-ejb-jar.xml configuration:

<sun-ejb-jar>
  <enterprise-beans>
    <ejb>
      <ejb-name>HRCoreEJB</ejb-name>
        <ior-security-config>
          <as-context>
             <auth-method>USERNAME_PASSWORD</auth-method>
             <realm>default</realm>
             <required>true</required>
          </as-context>
        </ior-security-config>
    </ejb>
  </enterprise-beans>
</sun-ejb-jar>

The default Realm is an LDAP realm which works fine if I use a standalone client with ProgrammaticLogin.

[i]ProgrammaticLogin login = new ProgrammaticLogin();
login.login("usernamel","password");

InitialContext ctx = new InitialContext();
                                
IHRCoreEJBRemote bean = (IHRCoreEJBRemote) ctx.lookup("ejb/HRCoreEJB");[/i]

However, I want to do this from a Tomcat instance where the EJB is injected using a Spring JNDI lookup. Spring is configured to do an LDAP lookup to the same LDAP server. Whatever I try I get a CORBA error NO_PERMISSON.

How do I configure Spring to pass the current authenticated username and password to Glassfish. I have been unable to find any useful documentation on this subject so far so would be grateful for some advise / examples.

Thanks,
Chris
[Message sent by forum member 'minty' (minty)]

http://forums.java.net/jive/thread.jspa?messageID=339155