2 Replies Latest reply on Nov 14, 2002 5:56 AM by Hans

    java.lang.SecurityException: Authentication exception, princ

    david Newbie

      I have two EJBs, one that is secure, and another that is not. I am using the non-secure one as a facade to the secured one. I have configured my jboss.xml to be the following:



      <configuration-name>Secure Stateless SessionBean</configuration-name>


      <container-configuration extends="Standard Stateless SessionBean">
      <container-name>Secure Stateless SessionBean</container-name>

      My non-secured EJB does not require a login, and I have it configured (in ejb-jar.xml) so that it will "run-as" an administrator role that the SecuredEJB will allow access to.







      Even though, I don't log into the non-secured EJB, it has a default "unsecureClient" principal associated with the invocation. But when my unsecured EJB tries to get a remote stub for the secured EJB, the SecurityInterceptor throws a SecurityException, stating that the principal is "null." Does this mean that my unsecured EJB must always log into the secured EJB, even though it has a default principle and its role as an "Administrator" is already set?

      thanks for your help,


        • 1. Re: java.lang.SecurityException: Authentication exception, p
          david Newbie

          I got it working. But I am not sure how I did it. I hope someone out there in the JBoss community is able to enlighten me. I added the following to "login-config.xml":

          <application-policy name = "myDomain">

          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required">
          <module-option name = "unauthenticatedIdentity">nobody</module-option>


          The only explanation I've found is a comment in the xml file:

          "The unauthenticatedIdentity property defines the name of the principal that will be used when a null username and password are presented as is the case for an unuathenticated web client or MDB. If you want to allow such users to be authenticated add the property, e.g., unauthenticatedIdentity='nobody' "

          Is there a file I can include in my EJB jar file that will override the default/login-config.xml, so I don't have to modify the one under the default directory?


          • 2. Re: Authentication exception, principal=null, LDAP?
            Hans Newbie

            Well that works with the UsersRolesLoginModule, but
            how can I do this with the LdapLoginModule?