6 Replies Latest reply on Mar 5, 2003 5:12 PM by Peter Doornbosch

    How do I add my own login module?

    Chris Newbie

      Hi,

      I made my own loginmodule class that I want to use in my webapplication for authentication. It's based on the usersroleslogin.
      But where do I put the class and how do I tell jboss to use my own loginmodule for my webapplication?

      Thanks

        • 1. Re: How do I add my own login module?
          Peter Doornbosch Apprentice

          > But where do I put the class

          Wrap it in a jar file and put that in the /server/default/lib directory (assuming you're using the default configuration). Also, you can create an extra dir for your libs and specify that one in the user-service.xml (see that file for an example).

          > and how do I tell jboss
          > to use my own loginmodule for my webapplication?
          add an application policy in the login-config.xml that uses your login module, and refer to that policy in the jboss-web.xml file in your war.

          • 2. Re: How do I add my own login module?
            Chris Newbie

            I tried it but it won't work.
            The jar I placed in the lib directory and the login-config.xml I placed the following:

            <application-policy name = "My Realm">

            <login-module code = "my.logins.MyLoginModule" flag = "required" />

            </application-policy>

            When I go to the secured part and I try to log in, I don't get exceptions, only the standard Authentication failed reports. Why doesn't it use my loginmodule?

            • 3. Re: How do I add my own login module?
              Chris Newbie

              Thanks, I tried it... but it won't work.
              I placed my jar in the lib directory and the following in the login-config.xml:
              ..
              <application-policy name = "My Realm">

              <login-module code = "my.logins.MyLoginModule" flag = "required" />

              </application-policy>
              ..

              When I come to the secured part of my website and try to log in I don't get any exceptions just messages that the authorization failed ( [jbossweb] WARNING: AUTH FAILURE: user testname )

              what could the problem be?

              • 4. Re: How do I add my own login module?
                Chris Newbie

                Thanks, I tried it... but it won't work.
                I placed my jar in the lib directory and the following in the login-config.xml:
                ..
                <application-policy name = "My Realm">

                <login-module code = "my.logins.MyLoginModule" flag = "required" />

                </application-policy>
                ..

                When I come to the secured part of my website and try to log in I don't get any exceptions just messages that the authorization failed ( [jbossweb] WARNING: AUTH FAILURE: user testname )

                What could the problem be?

                • 5. Re: How do I add my own login module?
                  Chris Newbie

                  Thanks, I tried it... but it won't work.
                  I placed my jar in the lib directory and the following in the login-config.xml:
                  ..
                  <application-policy name = "My Realm">

                  <login-module code = "my.logins.MyLoginModule" flag = "required" />

                  </application-policy>
                  ..

                  When I come to the secured part of my website and try to log in I don't get any exceptions just messages that the authorization failed ( [jbossweb] WARNING: AUTH FAILURE: user testname )

                  What could the problem be?

                  • 6. Re: How do I add my own login module?
                    Peter Doornbosch Apprentice

                    Are you sure it doesn't use your module? Based on the error message i'd say that it just can't authenticate your "testname" user, maybe because the password is incorrect or your module is not yet working correctly.
                    Did you put traces in your module? Are they never printed, not even after a fresh JBoss restart?