2 Replies Latest reply on Aug 28, 2008 7:24 AM by Patrick Madden

    postAuthenticate() is not public in Identity

    Patrick Madden Newbie

      Hi,


      I've been using Seam for a long time and have had my own derived class called ActiveDirectoryIdentity that when combined with jbosssx.jar and the LdapExtLoginModule. I have been able to authenticate against Active Directory.


      I have used the postAuthenticate method to help me out here however now I get the following compiler error when compiling my class.


      ActiveDirectoryIdentity.java:256: postAuthenticate() is not public in org.jboss.seam.security.Identity; cannot be accessed from outside package


      Is this an oversite or done on purpose.


      Here is my postAuthenticate method:


           
      void postAuthenticate()
      {               
          // seam nullifies the password and we do not want that.
          this.currentPassword = this.getPassword();
                               
          MethodExpression<?> mb = this.getAuthenticateMethod();
                     
          if (mb != null)
          {
              boolean auth = (Boolean) mb.invoke();
                          
              // TODO should we bail here if bridging to the database
              // or other stuff didn't work?
              if (!auth)
              {
                  log.warn("Failed to post authenticate active directory user using " +
                  "seam:security:Authentication method defined in components.xml");
              }               
                     
           super.postAuthenticate();          
          }
      }
      


      Then in my components.xml I've been doing this:


         <security:identity authenticate-method="#{identityToClUserBridge.bridge}" 
             jaas-config-name="ActiveDirectory"/>



      I then modify my login-config.xml file to contain an application policy




      I suppose I can just go and modify the code and rebuild but if there is another way, I'm open to it. I don't want to rewrite everything as its working however.


      Any help is greatly appreciate.


      Thanks,


      PVM

        • 1. Re: postAuthenticate() is not public in Identity
          Shane Bryzak Master

          Hmm, I can't recall the reason why I changed this.  Anyway, I've made the method protected again which should fix your issue.

          • 2. Re: postAuthenticate() is not public in Identity
            Patrick Madden Newbie

            Thank You!


            One other quick question. I am deployed to jboss-4.2.3.GA (this is new to me too) So I'm doing a double upgrade. I can now start my app server without any warnings or errors. However, when I go to my home page I get this stack trace. I'm just curious if you've seen this before or not.


            FYI I do have:



            <transaction:ejb-transaction/> 




            in my components.xml


            <?xml version="1.0" encoding="UTF-8"?>
            <components xmlns="http://jboss.com/products/seam/components"
                        xmlns:core="http://jboss.com/products/seam/core"
                        xmlns:framework="http://jboss.com/products/seam/framework"            
                        xmlns:persistence="http://jboss.com/products/seam/persistence"
                        xmlns:drools="http://jboss.com/products/seam/drools"
                        xmlns:bpm="http://jboss.com/products/seam/bpm"
                        xmlns:security="http://jboss.com/products/seam/security"
                        xmlns:mail="http://jboss.com/products/seam/mail"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns:async="http://jboss.com/products/seam/async"
                        xmlns:navigation="http://jboss.com/products/seam/navigation"
                        xmlns:transaction="http://jboss.com/products/seam/transaction"
                        xsi:schemaLocation=
                            "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                             http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.1.xsd
                             http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd 
                             http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                             http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                             http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                             http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                             http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd
                             http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.1.xsd
                             http://jboss.com/products/seam/navigation http://jboss.com/products/seam/navigation-2.1.xsd
                             http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd"> 
            
               <core:init debug="false" jndi-pattern="/#{ejbName}/local"/>
                 
               <core:manager concurrent-request-timeout="500" 
                             conversation-timeout="120000" 
                             conversation-id-parameter="cid"/>
                             
               <transaction:ejb-transaction />
             
               <persistence:managed-persistence-context name="entityManager"
                                                 auto-create="true"
                                  persistence-unit-jndi-name="java:/CloosterEntityManagerFactory"/>
            
               <security:identity authenticate-method="#{identityToClUserBridge.bridge}" 
                   jaas-config-name="ActiveDirectory"/>
                     
               <event type="org.jboss.seam.security.notLoggedIn">
                   <action execute="#{redirect.captureCurrentView}"/>
               </event>
               
               <event type="org.jboss.seam.security.loginSuccessful">
                   <action execute="#{redirect.returnToCapturedView}"/>
               </event>    
               
               <!--   
               <pdf:document-store use-extensions="true" error-page="/missingPDF.seam"/>
                -->
               
               <!-- Seam Email Support -->
               <mail:mail-session host="10.10.1.2" port="25" username="webmaster" password="lkjas;dlfkja;sdlfj" />
               
               <!-- Seam Redirection from http to https for pages that require it -->
               <navigation:pages http-port="8080" https-port="8443"/>     
                         
            </components>



            Many thanks in advance,


            PVM


            Here is the stack trace:


            jvm 1    | 01:11:40,164 INFO  [Contexts] starting up: org.jboss.seam.security.identity
            jvm 1    | 01:11:40,165 INFO  [ActiveDirectoryIdentity] Seam Security Identity Extension - ActiveDirectoryIdentity Constructor
            jvm 1    | 01:11:40,168 INFO  [Contexts] starting up: org.jboss.seam.security.ruleBasedPermissionResolver
            jvm 1    | 01:11:40,168 INFO  [Contexts] starting up: com.clooster.web.ejb.session.skinBean
            jvm 1    | 01:11:40,181 INFO  [Contexts] starting up: org.jboss.seam.web.session
            jvm 1    | 01:11:40,183 INFO  [SearchSessionListener$1] Session Created = 291932D3824EE53BD6EF19D0D730B174
            jvm 1    | 01:11:40,304 ERROR [SeamPhaseListener] swallowing exception
            jvm 1    | java.lang.IllegalStateException: Could not start transaction
            jvm 1    |      at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:594)
            jvm 1    |      at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:325)
            jvm 1    |      at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:142)
            jvm 1    |      at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
            jvm 1    |      at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
            jvm 1    |      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
            jvm 1    |      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:104)
            jvm 1    |      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
            jvm 1    |      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            jvm 1    |      at com.clooster.web.filter.JarFilter.doFilter(JarFilter.java:87)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
            jvm 1    |      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            jvm 1    |      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            jvm 1    |      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            jvm 1    |      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            jvm 1    |      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:150)
            jvm 1    |      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
            jvm 1    |      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:379)
            jvm 1    |      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:506)
            jvm 1    |      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            jvm 1    |      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            jvm 1    |      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            jvm 1    |      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
            jvm 1    |      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            jvm 1    |      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
            jvm 1    |      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
            jvm 1    |      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
            jvm 1    |      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            jvm 1    |      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            jvm 1    |      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
            jvm 1    |      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            jvm 1    |      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
            jvm 1    |      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            jvm 1    |      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
            jvm 1    |      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
            jvm 1    |      at java.lang.Thread.run(Unknown Source)
            jvm 1    | Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.transaction.synchronizations
            jvm 1    |      at org.jboss.seam.Component.newInstance(Component.java:2041)
            jvm 1    |      at org.jboss.seam.Component.getInstance(Component.java:1923)
            jvm 1    |      at org.jboss.seam.Component.getInstance(Component.java:1902)
            jvm 1    |      at org.jboss.seam.Component.getInstance(Component.java:1896)
            jvm 1    |      at org.jboss.seam.transaction.AbstractUserTransaction.getSynchronizations(AbstractUserTransaction.java:79)
            jvm 1    |      at org.jboss.seam.transaction.UTTransaction.begin(UTTransaction.java:40)
            jvm 1    |      at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:589)
            jvm 1    |      ... 50 more
            jvm 1    | Caused by: javax.naming.NameNotFoundException: EjbSynchronizations not bound
            jvm 1    |      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
            jvm 1    |      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
            jvm 1    |      at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
            jvm 1    |      at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
            jvm 1    |      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
            jvm 1    |      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
            jvm 1    |      at javax.naming.InitialContext.lookup(Unknown Source)
            jvm 1    |      at org.jboss.seam.Component.instantiateSessionBean(Component.java:1312)
            jvm 1    |      at org.jboss.seam.Component.instantiate(Component.java:1276)
            jvm 1    |      at org.jboss.seam.Component.newInstance(Component.java:2019)
            jvm 1    |      ... 56 more
            jvm 1    | 01:11:40,554 WARN  [SeamPhaseListener] uncaught exception, passing to exception handler
            jvm 1    | java.lang.IllegalStateException: Could not commit transaction
            jvm 1    |      at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:616)
            jvm 1    |      at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:343)
            jvm 1    |      at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:243)
            jvm 1    |      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
            jvm 1    |      at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
            jvm 1    |      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
            jvm 1    |      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:104)
            jvm 1    |      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
            jvm 1    |      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            jvm 1    |      at com.clooster.web.filter.JarFilter.doFilter(JarFilter.java:87)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
            jvm 1    |      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            jvm 1    |      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            jvm 1    |      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            jvm 1    |      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            jvm 1    |      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:150)
            jvm 1    |      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
            jvm 1    |      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:379)
            jvm 1    |      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:506)
            jvm 1    |      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            jvm 1    |      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            jvm 1    |      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            jvm 1    |      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            jvm 1    |      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            jvm 1    |      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
            jvm 1    |      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            jvm 1    |      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
            jvm 1    |      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
            jvm 1    |      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
            jvm 1    |      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            jvm 1    |      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            jvm 1    |      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
            jvm 1    |      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            jvm 1    |      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
            jvm 1    |      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            jvm 1    |      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
            jvm 1    |      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
            jvm 1    |      at java.lang.Thread.run(Unknown Source)
            jvm 1    | Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.transaction.synchronizations
            jvm 1    |      at org.jboss.seam.Component.newInstance(Component.java:2041)
            jvm 1    |      at org.jboss.seam.Component.getInstance(Component.java:1923)
            jvm 1    |      at org.jboss.seam.Component.getInstance(Component.java:1902)
            jvm 1    |      at org.jboss.seam.Component.getInstance(Component.java:1896)
            jvm 1    |      at org.jboss.seam.transaction.AbstractUserTransaction.getSynchronizations(AbstractUserTransaction.java:79)
            jvm 1    |      at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:48)
            jvm 1    |      at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:604)
            jvm 1    |      ... 50 more
            jvm 1    | Caused by: javax.naming.NameNotFoundException: EjbSynchronizations not bound
            jvm 1    |      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
            jvm 1    |      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
            jvm 1    |      at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
            jvm 1    |      at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
            jvm 1    |      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
            jvm 1    |      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
            jvm 1    |      at javax.naming.InitialContext.lookup(Unknown Source)
            jvm 1    |      at org.jboss.seam.Component.instantiateSessionBean(Component.java:1312)
            jvm 1    |      at org.jboss.seam.Component.instantiate(Component.java:1276)
            jvm 1    |      at org.jboss.seam.Component.newInstance(Component.java:2019)
            jvm 1    |      ... 56 more