1 Reply Latest reply on Jul 10, 2009 11:33 AM by Florent PICOT

    Identity.login doesn't work in jpdl page-flow.

    Florent PICOT Newbie

      Hello guys,


      I ran into a problem lately. I need to perform a regular login inside a page-flow process. I use the regular login method in the login.xhtml view:



      <h:form>
      <h:inputText id="username" required="true" size="30" maxlength="50"
                          value="#{credentials.username}">
                     </h:inputText>
      <h:inputSecret id="password" required="true" size="20" maxlength="20"
                               value="#{credentials.password}">
                          </h:inputSecret>
      <h:commandButton value="login" action="#{identity.login}"/>
      </h:form>



      Even when username and password are correct I run into this exception:




      2009-07-09 16:53:41,884 DEBUG [org.jboss.seam.security.Identity] Login failed for: flo                                                                                                                                                                                         
      javax.security.auth.login.LoginException: Echec de connexion : tous les modules ont été ignorés                                                                                                                                                                                
              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:344)                                                                                                                                                                                                    
              at org.jboss.seam.security.Identity.authenticate(Identity.java:332)                                                                                                                                                                                                    
              at org.jboss.seam.security.Identity.login(Identity.java:259)                                                                                                                                                                                                           
              at com.lrb.modules.order.OrderManager.login(OrderManager.java:135)                                                                                                                                                                                                     
              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:597)                                                                                                                                                                                                                    
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)                                                                                                                                                                                                         
              at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)                                                                                                                                                                               
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)                                                                                                                                                                               
              at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)                                                                                                                                                                            
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)                                                                                                                                                                               
              at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)                                                                                                                                                                                 
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)                                                                                                                                                                               
              at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:65)                                                                                                                                                                           
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)                                                                                                                                                                               
              at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)                                                                                                                                                                      
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)                                                                                                                                                                               
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)                                                                                                                                                                         
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)                                                                                                                                                                               
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)                                                                                                                                                                                           
              at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)                                                                                                                                                                      
              at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)                                                                                                                                                                                   
              at com.lrb.modules.order.OrderManager_$$_javassist_seam_38.login(OrderManager_$$_javassist_seam_38.java)                                                                                                                                                               
              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:597)                                                                                                                                                                                                                    
              at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)                                                                                                                                                                                              
              at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)                                                                                                                                                                                              
              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:88)                                                                                                                                                     
              at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)                                                                                                                                                                             
              at javax.faces.component.UICommand.broadcast(UICommand.java:387)                                                                                                                                                                                                       
              at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)                                                                                                                                                                                            
              at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)                                                                                                                                                                                          
              at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)                                                                                                                                                                                             
              at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)                                                                                                                                                                                       
              at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)                                                                                                                                                                              
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)                                                                                                                                                                                                               
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)                                                                                                                                                                                               
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)                                                                                                                                                                                                      
              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.web.RewriteFilter.doFilter(RewriteFilter.java:63)                                                                                                                                                                                                    
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)                                                                                                                                                                                      
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)                                                                                                                                                                                                  
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)                                                                                                                                                                                      
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)                                                                                                                                                                                                
              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.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)                                                                                                                                                                                
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)                                                                                                                                                                                      
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)                                                                                                                                                                                               
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)                                                                                                                                                                                                   
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)                                                                                                                                                                                  
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)                                                                                                                                                                                                        
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)                                                                                                                                                                                                  
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)                                                                                                                                                                                      
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)                                                                                                                                                                                                    
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)                                                                                                                                                                                      
              at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)                                                                                                                                                                                                
              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:182)                                                                                                                                                                    
              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:619)



      My page-flow is quite simple:



      <pageflow-definition name="pageflow">
           <start-state name="initialize">
                <redirect/>
                <transition name="testLogin" to="IsUserLogged"/>
           </start-state>
      
           <decision name="IsUserLogged" expression="#{identity.isLoggedIn()}">
                <redirect/>
               <transition name="true" to="next"/>
                <transition name="false" to="loginViewId"/>
           </decision>
      
           <page name="loginViewId" view-id="/login.xhtml">
                <redirect/>
                <transition name="loggedIn" to="next"/>
           </page>
      </pageflow-definition>
      



      I tested login.xhtml outside of the page-flow and it works.