3 Replies Latest reply on Dec 1, 2015 2:40 AM by Rasmus Moustgaard

    login() method called repeatedly

    Rasmus Moustgaard Newbie

      After upgrading to WildFly 9.0.2 I notice that the login() method of my custom login module (extending DatabaseServerLoginModule) is being called for every single page request. This did not happen in JBoss 7.3.0 where the login module was only called once each time a user logged in (via form based authentication). Is this intentional?

        • 1. Re: login() method called repeatedly
          Rasmus Moustgaard Newbie

          Actually it's not only calling the login method, but it also seems to create a new custom login module instance for every request.

          • 2. Re: login() method called repeatedly
            Martin Choma Master

            You have to specify cache-type="default", when you don't specify cache type none is used.


                     <security-domain name="Ldap-default" cache-type="default">


                                    <login-module code="Ldap" flag="required">

                                        <module-option name="matchOnUserDN" value="true"/>

                                        <module-option name="principalDNPrefix" value="uid="/>

                                        <module-option name="uidAttributeID" value="member"/>

                                        <module-option name="java.naming.security.principal" value="uid=admin,ou=system"/>

                                        <module-option name="java.naming.factory.initial" value="com.sun.jndi.ldap.LdapCtxFactory"/>

                                        <module-option name="java.naming.provider.url" value="ldap://localhost.localdomain:10389"/>

                                        <module-option name="roleAttributeIsDN" value="false"/>

                                        <module-option name="principalDNSuffix" value=",ou=People,o=LdapLoginModuleTestCase25b7ee6e,o=primary,dc=jboss,dc=org"/>

                                        <module-option name="roleAttributeID" value="cn"/>

                                        <module-option name="java.naming.security.credentials" value="secret"/>

                                        <module-option name="rolesCtxDN" value="ou=Roles,o=LdapLoginModuleTestCase25b7ee6e,o=primary,dc=jboss,dc=org"/>

                                        <module-option name="java.naming.security.authentication" value="simple"/>




            • 3. Re: login() method called repeatedly
              Rasmus Moustgaard Newbie

              Thanks, I had missed that option.