0 Replies Latest reply on May 13, 2014 9:12 AM by avico81

    No authenticator available for programmatic login

    avico81

      Hi

       

      I keep getting this error whenever I try to login with two different users in two different sessions.

       

      13:27:28,444 ERROR [com.commit.steam.rest.RestLoginService] (http-localhost-127.0.0.1-8080-2) Error on login: javax.servlet.ServletException: No authenticator available for programmatic login

        at org.apache.catalina.connector.Request.login(Request.java:3254) [jbossweb-7.0.13.Final.jar:]

        at org.apache.catalina.connector.RequestFacade.login(RequestFacade.java:1082) [jbossweb-7.0.13.Final.jar:]

        at com.commit.steam.rest.RestLoginService.login(RestLoginService.java:128) [steam-rest-api-0.1.6-SNAPSHOT.jar:]

       

      from standalone.xml:

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

                          <authentication>

                              <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">

                                  <module-option name="dsJndiName" value="java:jboss/datasources/STEAMDS"/>

                                  <module-option name="principalsQuery" value="select U.PASSWORD from USERS U where U.EMAIL=?"/>

                                  <module-option name="rolesQuery" value="select R.NAME, 'Roles' from USERS U join USER_ROLES UR on U.ID = UR.USER_ID join ROLES R on UR.ROLE_ID = R.ID where U.EMAIL=?"/>

                                  <module-option name="hashAlgorithm" value="SHA-256"/>

                                  <module-option name="hashEncoding" value="base64"/>

                              </login-module>

                          </authentication>

                      </security-domain>

       

      jboss-web.xml:

      <?xml version="1.0"?>

      <jboss-web>

        <security-domain>steam</security-domain>

      </jboss-web>

       

      I use JBoss-as 7.1.1.Final

       

      While debugging I can see that the first request (HttpServletRequest.context.authenticator) has the NonLoginAuthenticator and the login with the second session doesn't have any authenticator attached to it (i.e. HttpServletRequest.context.authenticator is null).

      Every following request in the first session has the same Authenticator on the request (when I test business flows for one user).

       

      I tried switching the sessions (I use Chrome and FireFox to ensure different sessions) but it didn't change anything.

       

      Does anyone have any idea or lead on where I need to look for this issue?

       

      Thanks a lot

      Avi