7 Replies Latest reply on May 7, 2008 2:51 AM by Shane Bryzak

    Authentication Query.

    Richard Gordon Newbie

      Hi,


      I am new to seam and have been playing around with a few of the example projects. I have a query on the authenitcation classes.


      What I would like to do is validate the username and password and if correct I would also like to check other properties such as is the account locked, password not changed for some time, etc. These other checks would result in a message other than the standard org.jboss.seam.loginFailed message. I though these checks could be done in the authenticate method of my Authenticator class, but this method only returns a boolean which I presume them cause the standard Seam message to be displayed.


      So I guess my question is what is the correct way to add extra login checks to my seam app that allow me to fail authentication and return different messages depending on the reason.


      Thanks,


      Richard

        • 1. Re: Authentication Query.
          Shane Bryzak Master

          You can generate any additional messages that you want in your authenticate method, and simply call Identity.authenticate() (instead of Identity.login(), which generates the default messages) to authenticate.

          • 2. Re: Authentication Query.
            Ananthan Rudran Newbie

            You can try modifying the messages.properties file of Seam.Assign empty string value. And add your own message to the FacesMessages.

            • 3. Re: Authentication Query.
              Richard Gordon Newbie

              Thanks for the quick replies.


              I have added the additional messages to my authenticate method which is now displayed as well as the standard Seam message. When you say I should call Identity.authenticate instead of Identity.login() I am not too sure what you mean as I though I was writing all the authentication code in my method as shown below :-



              @Stateless
              @Name("authenticator")
              public class AuthenticatorAction implements AuthenticatorLocal
              {
                  @Logger 
                  private Log log;
                  
                  @In  
                  private Identity identity;
                  
                  @In(create=true) 
                  FacesMessages facesMessages;
                  
                  
                  @PersistenceContext
                  private EntityManager em;    
                  
                  @SuppressWarnings("unchecked")
                  public boolean authenticate()
                  {
                      log.info("authenticating #0", identity.getUsername());
                      
                      Query query = em.createNamedQuery("FindByUsername") ;
                      query.setParameter("username", identity.getUsername().toUpperCase()) ;
                      List<User> results = query.getResultList() ;
                      
                      if ( results.size() == 0 )
                           return false;
                
                      // There should only be one so just get the first.
                      User user = results.get(0);
                      
                      boolean isPwdValid = user.CheckPassword(identity.getPassword());
                      if (!isPwdValid)
                              return false ;
              
                      
                      if (user.isLocked())
                      {
                           facesMessages.addFromResourceBundle("symnet.login.locked") ;
                           return false ;
                           
                      }
                      
                      // Sort out roles from database - just add admin for now
                      
                      identity.addRole("admin") ;
                      
                      user.setLastLoggedIn(new Date()) ;
                      em.persist(user) ;
                      
                      return true;
                  }
              }



              I am not too sure how I stop the standard seam authentication message.


              Thanks,


              Richard


              • 4. Re: Authentication Query.
                Ananthan Rudran Newbie

                Did you try clearing the Seam message in the property files.Then add your own  in your code

                • 5. Re: Authentication Query.
                  Shane Bryzak Master

                  The standard authentication messages are generated from events raised in Identity.login().  If you call Identity.authenticate() instead, then the default messages won't be generated.  I assume you have a button or something on your login form that has action="#{identity.login}", this is what you need to change.

                  • 6. Re: Authentication Query.
                    Richard Gordon Newbie

                    Ahhh. I did say I was new to this stuff!!


                    I have updated the code to always return my messages and if I use the Identity.login I get my message and the Seam standard message as expected , however if I change the action on my login page to identity.authenticate. I now get a the following exception returned, I have searched the forums and came up with nothing on this error. Any ideas?


                    Thanks,


                    Richard


                    20:29:07,406 FATAL [application] javax.security.auth.login.LoginException: Login Failure: all modules ignored
                    javax.faces.el.EvaluationException: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                         at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                         at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:316)
                         at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:291)
                         at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:248)
                         at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:461)
                         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                         at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
                         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
                         at org.ajax4jsf.Filter.doFilter(Filter.java:175)
                         at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                         at java.lang.Thread.run(Thread.java:595)
                    Caused by: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
                         at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
                         at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
                         at java.security.AccessController.doPrivileged(Native Method)
                         at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
                         at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
                         at org.jboss.seam.security.Identity.authenticate(Identity.java:259)
                         at org.jboss.seam.security.Identity.authenticate(Identity.java:248)
                         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:585)
                         at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                         at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
                         at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
                         at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                         at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                         at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
                         ... 48 more
                    20:29:07,406 WARN  [lifecycle] #{identity.authenticate}: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                    javax.faces.FacesException: #{identity.authenticate}: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
                         at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                         at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:316)
                         at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:291)
                         at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:248)
                         at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:461)
                         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                         at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
                         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
                         at org.ajax4jsf.Filter.doFilter(Filter.java:175)
                         at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                         at java.lang.Thread.run(Thread.java:595)
                    Caused by: javax.faces.el.EvaluationException: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                         ... 47 more
                    Caused by: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
                         at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
                         at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
                         at java.security.AccessController.doPrivileged(Native Method)
                         at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
                         at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
                         at org.jboss.seam.security.Identity.authenticate(Identity.java:259)
                         at org.jboss.seam.security.Identity.authenticate(Identity.java:248)
                         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:585)
                         at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                         at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
                         at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
                         at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                         at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                         at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
                         ... 48 more
                    20:29:07,421 WARN  [lifecycle] executePhase(INVOKE_APPLICATION 5,com.sun.faces.context.FacesContextImpl@f9a36a) threw exception
                    javax.faces.FacesException: #{identity.authenticate}: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:105)
                         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                         at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
                         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
                         at org.ajax4jsf.Filter.doFilter(Filter.java:175)
                         at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                         at java.lang.Thread.run(Thread.java:595)
                    Caused by: javax.faces.FacesException: #{identity.authenticate}: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
                         at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                         at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:316)
                         at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:291)
                         at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:248)
                         at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:461)
                         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                         ... 41 more
                    Caused by: javax.faces.el.EvaluationException: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                         ... 47 more
                    Caused by: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
                         at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
                         at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
                         at java.security.AccessController.doPrivileged(Native Method)
                         at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
                         at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
                         at org.jboss.seam.security.Identity.authenticate(Identity.java:259)
                         at org.jboss.seam.security.Identity.authenticate(Identity.java:248)
                         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:585)
                         at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                         at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
                         at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
                         at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                         at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                         at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
                         ... 48 more
                    20:29:07,421 ERROR [ExceptionFilter] handling uncaught exception
                    javax.servlet.ServletException: #{identity.authenticate}: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                         at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
                         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
                         at org.ajax4jsf.Filter.doFilter(Filter.java:175)
                         at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                         at java.lang.Thread.run(Thread.java:595)
                    Caused by: javax.faces.FacesException: #{identity.authenticate}: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
                         at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                         at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:316)
                         at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:291)
                         at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:248)
                         at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:461)
                         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                         ... 38 more
                    Caused by: javax.faces.el.EvaluationException: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                         ... 47 more
                    Caused by: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
                         at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
                         at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
                         at java.security.AccessController.doPrivileged(Native Method)
                         at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
                         at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
                         at org.jboss.seam.security.Identity.authenticate(Identity.java:259)
                         at org.jboss.seam.security.Identity.authenticate(Identity.java:248)
                         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:585)
                         at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                         at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
                         at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
                         at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                         at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                         at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
                         ... 48 more
                    20:29:07,421 ERROR [ExceptionFilter] exception root cause
                    javax.faces.FacesException: #{identity.authenticate}: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
                         at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                         at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:316)
                         at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:291)
                         at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:248)
                         at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:461)
                         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                         at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
                         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
                         at org.ajax4jsf.Filter.doFilter(Filter.java:175)
                         at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                         at java.lang.Thread.run(Thread.java:595)
                    Caused by: javax.faces.el.EvaluationException: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
                         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                         ... 47 more
                    Caused by: javax.security.auth.login.LoginException: Login Failure: all modules ignored
                         at javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
                         at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
                         at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
                         at java.security.AccessController.doPrivileged(Native Method)
                         at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
                         at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
                         at org.jboss.seam.security.Identity.authenticate(Identity.java:259)
                         at org.jboss.seam.security.Identity.authenticate(Identity.java:248)
                         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:585)
                         at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                         at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
                         at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
                         at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                         at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                         at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                         at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
                         ... 48 more 



                    • 7. Re: Authentication Query.
                      Shane Bryzak Master

                      The stack trace doesn't reveal the underlying cause of the login failure, you may need to use your debugger to find out why it's failing.  I suggest you start by setting a breakpoint in your authenticate method to see if something there is causing the exception, failing that I would set a breakpoint in Identity.authenticate() and you should be able to inspect the cause of the exception there.