1 Reply Latest reply on Sep 30, 2011 6:52 AM by kien nguyen

    GateIn CustomMembershipLoginModule Changes

    Megha Shah Newbie

      Hi,

      I have made changes to CustomMembershipLoginModule to render my custom login page.

      The authentication works fine. But when I supply a bad username/password, I am not sure where the control goes (inside GateIn)?

       

      Also, I have to process certain subscriber related information if the authentication is successful. I tried doing this inside the login() method of CustomMembershipLoginModule class. But it throws this exception : " javax.servlet.ServletException: Failed to authenticate a principal"

       

      My question is can I not add/modify anything to this class CustomMembershipLoginModule ?

       

      If so, what is the right way of doing it. Attached the sample code which I modified.

       

      Thanks,

      Megha

        • 1. Re: GateIn CustomMembershipLoginModule Changes
          kien nguyen Newbie

          JAAS of Application Server controls flow of Login process. When user access protected servlets, JAAS will enable login flow for authentication.

          My question is can I not add/modify anything to this class CustomMembershipLoginModule ?

          By default, GateIn doesn't use CustomMembershipLoginModule. What you can do in CustomMembershipLoginModule? it depends where you inserted this module in Login flow of JAAS.

           

          When your login fail with wrong username/password, JAAS redirect page to error login page. In GateIn, it's /errorlogin servlet and configured in portal.war/WEB-INF/web.xml:

          <login-config>

                <auth-method>FORM</auth-method>

                <realm-name>gatein-domain</realm-name>

                <form-login-config>

                   <form-login-page>/initiatelogin</form-login-page>

                   <form-error-page>/errorlogin</form-error-page>

                </form-login-config>

             </login-config>