0 Replies Latest reply on Apr 3, 2012 12:58 PM by christib

    JAAS authentication with Seam3, packaged as an EAR

    christib

      I am trying to do JAAS authentication with Seam 3.1.0 in a JBoss 7 container.  Per suggestions made by http://seamframework.org/149168.lace, I created an authenticator and packaged it in a JAR with the following beans.xml:

       

      <beans xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:s="urn:java:ee"
             xmlns:security="urn:java:org.jboss.seam.security"
             xmlns:p="urn:java:com.mycompany"
             xsi:schemaLocation="
              http://java.sun.com/xml/ns/javaee
              http://docs.jboss.org/cdi/beans_1_0.xsd">
      
        <interceptors>
          <class>org.jboss.seam.security.SecurityInterceptor</class>
        </interceptors>
        <p:MyJAAS>
          <s:modifies/>
          <p:jaasConfigName>myJAASConfig</p:jaasConfigName>
        </p:MyJAAS>
        <security:IdentityImpl>
          <s:modifies/>
          <security:authenticatorClass>com.mycompany.MyJAAS</security:authenticatorClass>
        </security:IdentityImpl>
      
      </beans>
      

       

      The JAR is packaged in the WEB-INF/lib directory of a WAR (along with all of the Seam libraries), that is then packaged in an EAR.  When I try to do identity.login from a facelet, I get the following exception:

       

      java.lang.IllegalStateException: jaasConfigName cannot be null.  Please set it to a valid JAAS configuration name.

          at com.perooski.MyJAAS.authenticate(MyJAAS.java:60) [jaastest-1.0.jar:]

          at com.perooski.MyJAAS$Proxy$_$$_WeldClientProxy.authenticate(MyJAAS$Proxy$_$$_WeldClientProxy.java) [jaastest-1.0.jar:]

          at org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:224) [seam-security-3.1.0.Final.jar:3.1.0.Final]

       

      This implies that the XML to set the jaasConfigName is not being executed (I think Solder is supposed to do this).

       

      This works fine if I copy the WAR deployment out of the EAR and deploy the WAR on its own.  Any ideas?