4 Replies Latest reply on Sep 3, 2010 7:45 AM by tagnegilles

    PasswordHash problem

    tagnegilles

      Hi Guys,



      i have a Seam 2.2.0 application which is deployed on JBoss 4.2.3.GA. The application perfoms well and uses the authenticate method. This method use another methtod to encrypt the password. This application is already in production. My goal is to change the Security concept and use the IdentityManager to authenticate the users. I have already add all Security annotations on the user-class and role-class. i tried to extend the PasswordHash class like this:





      @Scope(value = org.jboss.seam.ScopeType.STATELESS)
      @Name(value = "org.jboss.seam.security.passwordHash")
      @Install(true)
      @BypassInterceptors
      public class PasswordHashTT extends PasswordHash {
      
          @Override
          public String generateHash(String passwordToHash) {       
              return Toolkit.fingerprintString(passwordToHash);
          }
      
          @Override
          public String generateHash(String passwordToHash, String pAlg) {
              return Toolkit.fingerprintString(passwordToHash);
          }
          
          @Override
          public String createPasswordKey(char[] passwordToHash, byte[] arg1, int arg2)
                    throws GeneralSecurityException {
               return Toolkit.fingerprintString(passwordToHash.toString());
          }
          
      }





      The methtod fingerprintString() encrypts the password. When i deploy my application the component is installed, but a user couldn't be authenticate.




      10:55:40,058 INFO  [Component] Component: org.jboss.seam.security.passwordHash, scope: STATELESS, type: JAVA_BEAN, class: de.gilles.projects.jobmanager.util.security.PasswordHashTT





      When i use the passwordHash component of seam it's work well. May be somebody has already do something like this. I really need help



      Thanks