[seam-commits] Seam SVN: r7750 - trunk/src/main/org/jboss/seam/security/management.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Mar 31 08:17:17 EDT 2008


Author: shane.bryzak at jboss.com
Date: 2008-03-31 08:17:16 -0400 (Mon, 31 Mar 2008)
New Revision: 7750

Modified:
   trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
   trunk/src/main/org/jboss/seam/security/management/LdapIdentityStore.java
Log:
components should be BUILT_IN

Modified: trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java	2008-03-31 09:13:02 UTC (rev 7749)
+++ trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java	2008-03-31 12:17:16 UTC (rev 7750)
@@ -1,6 +1,7 @@
 package org.jboss.seam.security.management;
 
 import static org.jboss.seam.ScopeType.APPLICATION;
+import static org.jboss.seam.annotations.Install.BUILT_IN;
 
 import java.io.Serializable;
 import java.lang.reflect.Field;
@@ -33,7 +34,7 @@
  * @author Shane Bryzak
  */
 @Name("org.jboss.seam.security.management.jpaIdentityStore")
- at Install(value=false) 
+ at Install(precedence = BUILT_IN, value=false) 
 @Scope(APPLICATION)
 @BypassInterceptors
 public class JpaIdentityStore implements IdentityStore, Serializable
@@ -190,7 +191,7 @@
          }
          else
          {
-            account.setPasswordHash(PasswordHash.generateHash(password, username));
+            account.setPasswordHash(PasswordHash.generateHash(password, getAccountSalt(account)));
             account.setEnabled(true);            
          }
          
@@ -213,6 +214,11 @@
       }      
    }
    
+   protected String getAccountSalt(UserAccount account)
+   {
+      return account.getUsername();
+   }
+   
    public boolean createUser(String username, String password)
    {
       return createUser(username, password, null, null);
@@ -373,7 +379,7 @@
          throw new NoSuchUserException("Could not change password, user '" + name + "' does not exist");
       }
       
-      account.setPasswordHash(PasswordHash.generateHash(password, name));
+      account.setPasswordHash(PasswordHash.generateHash(password, getAccountSalt(account)));
       mergeAccount(account);
       return true;
    }
@@ -457,7 +463,7 @@
          return false;
       }
       
-      String passwordHash = PasswordHash.generateHash(password, username);
+      String passwordHash = PasswordHash.generateHash(password, getAccountSalt(account));
       boolean success = passwordHash.equals(account.getPasswordHash());
             
       if (success && Events.exists())

Modified: trunk/src/main/org/jboss/seam/security/management/LdapIdentityStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/LdapIdentityStore.java	2008-03-31 09:13:02 UTC (rev 7749)
+++ trunk/src/main/org/jboss/seam/security/management/LdapIdentityStore.java	2008-03-31 12:17:16 UTC (rev 7750)
@@ -1,6 +1,7 @@
 package org.jboss.seam.security.management;
 
 import static org.jboss.seam.ScopeType.APPLICATION;
+import static org.jboss.seam.annotations.Install.BUILT_IN;
 
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -35,7 +36,7 @@
  * @author Shane Bryzak
  */
 @Name("org.jboss.seam.security.management.ldapIdentityStore")
- at Install(value=false) 
+ at Install(precedence = BUILT_IN, value=false) 
 @Scope(APPLICATION)
 @BypassInterceptors
 public class LdapIdentityStore implements IdentityStore, Serializable




More information about the seam-commits mailing list