13 Replies Latest reply on Mar 22, 2008 9:02 PM by Kenneth Christensen

    SeamLoginModule No authentication method defined

    Chris Latimer Newbie

      I am trying to build my first SEAM application, and am encountering a frustrating problem.  I have followed the SEAM examples pretty closely, but my authenticate method is not recognized by SEAM.  When I authenticate, I get this message:




      ERROR [SeamLoginModule] No authentication method defined - please define authenticate-method for <security:identity/> in components.xml


      I have written a simple JSF login form that culminates in the commandButton tag:


      <h:commandButton action="#{identity.login}"         value="#{messages.loginSubmitLabel}"/>


      Inside components.xml, I have configured my security:identity like this:


      <security:identity authenticate-method="#{authenticator.authenticate}"/>


      The components.xml is located in the WEB-INF directory of my WAR file.


      I have archived the application's ejb components into their own JAR file.  Note: I do not have any entity beans yet, so I do not have a persistence.xml.


      Here is the source for my authenticator stateless session bean:


      @Stateless
      @Name("authenticator")
      public class AuthenticatorAction implements AuthenticatorActionLocal
      {
          @In Identity identity;
          
          public boolean authenticate()
          {
              System.out.println("authenticating...");
              Identity.instance().addRole("Role1");
              return true;
          }
      }



      My EAR file is structured as follows:


      META-INF
        -application.xml
        -jboss-app.xml
      webapp.war
      ejbapp.jar
      jboss-seam.jar
      



      I would be extremely grateful if someone could help me get over this hurdle. If seeing the contents of other files in my application would be helpful please let me know.  I'll keep trying to solve this one today and post the solution if I find it.


      Chris Latimer