2 Replies Latest reply on Oct 29, 2008 1:39 AM by hsingh2

    any known changes in SeamContext in 2.1.0.GA ?

    hsingh2
      Hi,

      I am using window SSO with Seam and it is in production with seam version 2.0.1.SP1

      [window SSO=>http://sdudzin.blogspot.com/2007/12/windows-sso-with-jboss-seam.html]

      here is authenticator class that works with old version but not with seam 2.1.0.GA

      `@Name("authenticator")
      @Install(precedence=Install.FRAMEWORK)
      public class Authenticator {
         
          @In
          private SessionContext sessionContext

          @In
          private Identity identity;
          public boolean authenticate() {
              final NtlmPasswordAuthentication auth = (NtlmPasswordAuthentication)
              sessionContext.get("NtlmHttpAuth");
                
              boolean isAuthenticated = false;
              String username = null;

              if (identity.isLoggedIn()) {
                     isAuthenticated = true;
              } else {
                   if (auth != null) {
                   username = auth.getUsername();
                   isAuthenticated = true;
                   }
              }
              return isAuthenticated;
          }
      }
      `


      here is my component.xml


      ` <security:rule-based-permission-resolver security-rules="#{securityRules}"/>
        <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>
        
         <event type="org.jboss.seam.security.notLoggedIn">
               <action execute="#{authenticator.authenticate}" />
            <action execute="#{redirect.captureCurrentView}"/>
         </event>`

      here is pages.xml
      ` <page view-id="*" login-required="true">
              <action execute="#{authenticator.authenticate}" />
              <navigation>
                  <rule if-outcome="home">
                      <redirect view-id="/home.xhtml"/>
                  </rule>
              </navigation>
          </page> `
      now we are tring to upgrade to seam 2.0.1 GA but unfortunately it fails as sessionContext has no variable name NtlmHttpAuth,  but as the link shows i already has the NTMLFilter defined as before and it works perfect with seam version 2.0.1.SP1

      and this is new project setup * all the dependencies are according to seam 2.1.0.GA docs
      so now i am wondering that  am i missing anything ? or there is any changes in SessionContext
      implementation

      Thanks in Advance!

        • 1. Re: any known changes in SeamContext in 2.1.0.GA ?
          hsingh2

          sorry here with the code block....


          I am using window SSO with Seam and it is in production with seam version 2.0.1.SP1


          window SSO


          here is authenticator class that works with old version but not with seam 2.1.0.GA



          @Name("authenticator")
          @Install(precedence=Install.FRAMEWORK)
          public class Authenticator {
                   @In
              private SessionContext sessionContext
          
              @In
              private Identity identity;
              public boolean authenticate() {
                  final NtlmPasswordAuthentication auth = (NtlmPasswordAuthentication)
                  sessionContext.get("NtlmHttpAuth");
                              boolean isAuthenticated = false;
                  String username = null;
                    if (identity.isLoggedIn()) {
                         isAuthenticated = true;
                  } else {
                       if (auth != null) {
                       username = auth.getUsername();
                       isAuthenticated = true;
                       }
                  }
                  return isAuthenticated;
              }
          }




          here is my component.xml


          <security:rule-based-permission-resolver security-rules="#{securityRules}"/>
            <security:identity authenticate-method="#{authenticator.authenticate}"   remember-me="true"/>
                 <event type="org.jboss.seam.security.notLoggedIn">
                   <action execute="#{authenticator.authenticate}" />
                <action execute="#{redirect.captureCurrentView}"/>
             </event>



          here is pages.xml


          <page view-id="*" login-required="true">
                  <action execute="#{authenticator.authenticate}" />
                  <navigation>
                      <rule if-outcome="home">
                          <redirect view-id="/home.xhtml"/>
                      </rule>
                  </navigation>
              </page>


          now we are tring to upgrade to seam 2.1.0 GA but unfortunately it fails as sessionContext has no variable name NtlmHttpAuth, but as the link shows i already has the NTMLFilter defined as before and it works perfect with seam version 2.0.1.SP1


          and this is new project setup and all the dependencies are according to seam 2.1.0.GA docs
          so now i am wondering that am i missing anything ? or there is any changes in SessionContext
          implementation


          Thanks in Advance!

          • 2. Re: any known changes in SeamContext in 2.1.0.GA ?
            hsingh2

            never mind , problem is not in SeamContext or the filter
            Actually my authenticator is in a separate jar file project-seam.jar and which has seam.properties file and this jar is placed under ear/lib/ folder


            so now it is unable to create or locate the component authenticator at all and throw the exception authenticator resolve to null.
            but if i shift project-seam.jar to my web-app-project/Web-INF/lib folder then it works fine
            please take a look at my authenticator.java class, is there any change the seam scan the components in the different jar files  ?


            also is there any change in this tag


            @Install(precedence=Install.FRAMEWORK)




            Thanks