1 Reply Latest reply on Aug 29, 2002 10:48 AM by Brian

    Calling jaas from an ejb

    toddrun Newbie

      We have an ejb that has already collected a username and password from the user. We want to authenticate the username and password against an LDAP server using jaas.

      The java api for CallBackHandler says that "An implementation may also choose to obtain requested information from an alternate source without asking the end user." How would we make the "alternate source" a calling ejb?

      Any ideas are appreciated.

        • 1. Re: Calling jaas from an ejb
          Brian Newbie

          I would think that you could create a new CallbackHandler in the ejb that contains the username and password, and create a new LoginContext with it and call the .login() method, all from within the ejb. As long as you have an LdapLoginModule entry in the auth.conf or login-config.xml (depending on what jboss version you are using) and import the correct classes into the ejb, I don't see any reason this shouldn't work. But then again, it might be a dumb idea or one you thought of already.
          tool