3 Replies Latest reply on Sep 18, 2001 7:46 AM by Nathaniel Auvil

    Unable to load LoginModule

    Erik Karlsson Newbie

      Hi,
      I'm currently working with JBoss 2.4 (+Jetty) and Orion. Now I have a problem with JAAS's

      LoginContext
      . (In both appservers) When I call it's login() method I will get an exception: unable to find LoginModule class: [class name]. My class is in classpath, I'm sure about that. I call the class in one of my servlets.

      I have configured te auth.conf so that it contains my LoginModule class name (jetty's in Jboss and my own conf file in Orion).

      Have anyone else encounter the same problem?

      - Erik


        • 1. Re: Unable to load LoginModule
          Scott Stark Master

          The LoginModules need to be on the system classpath due to class loading restrictions with JAAS.

          • 2. Re: Unable to load LoginModule
            Dave Elliot Newbie

            Hi Scott,

            Regarding this issue, what do you suggest is the best approach to adding your custom LoginModules to the system classpath? I built my custom LoginModule into a jar and have placed it in $jboss.dist/lib. Then added it to JBOSS_CLASSPATH in run.sh.

            This works, however I'm not that happy about editing run.sh to add a new LoginModule lib. Do you have a better suggestion?

            p.s. My custom LoginModule is an LDAP based one, derived from your example LdapLoginModule.java (I've had to modify due to peculiarities with our schema). Anyway, just thought I'd note that there is a small typo in the 'sample login config' dooco in the LDAP logic module source. No ';' has been included at the end of the configuration block options, and the '//' in the value 'ldap://siren-int' caused my JBoss to get upset, possibly due to // being a comment?

            Anyway thought I'd point this out as having a ';' in the wrong place in a configuration block makes JBoss very unhappy and it's not very nice at telling exactly why it's unhappy!


            Anyway thanks for your JavaWorld article, very helpful in getting this stuff running.

            Dave


            • 3. Re: Unable to load LoginModule
              Nathaniel Auvil Newbie

              you can use the ProxyLoginModule to bootstrap your login modules.

              For example:

              example1 {
              org.jboss.security.auth.spi.ProxyLoginModule required
              moduleName=org.jboss.docs.jaas.howto.NathanielLoginModule;

              };