Changeset 680


Ignore:
Timestamp:
02/26/10 16:54:08 (7 months ago)
Author:
max
Message:

fix for pub user auth pb

Location:
trunk/src/com/calenco
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/com/calenco/security/SUSecurityManager.java

    r675 r680  
    2626import com.calenco.repository.PooledRepoManager; 
    2727import com.calenco.repository.dao.UserDAO; 
     28import java.math.BigInteger; 
    2829import java.security.SecureRandom; 
    2930import javax.jcr.PathNotFoundException; 
     
    6869            pubuser.setName("Special User Running Publications"); // NOI18N 
    6970            SecureRandom rng = new SecureRandom(); 
    70             byte[] passBytes = new byte[20]; 
     71            pubPass = new BigInteger(130, rng).toString(36); 
     72            /*byte[] passBytes = new byte[20]; 
    7173            rng.nextBytes(passBytes); 
    72             pubPass = new String(passBytes); 
     74            pubPass = new String(passBytes);*/ 
    7375            pubuser.setPassword(pubPass); 
    7476            pubuser = new UserDAO(session).addOrUpdate(pubuser); 
  • trunk/src/com/calenco/transform/PublicationManager.java

    r674 r680  
    237237 
    238238    private class InternalAuthenticator extends Authenticator { 
     239        char[] passwd = SUSecurityManager.getInstance().getPubPass().toCharArray(); 
     240 
    239241        @Override 
    240242        protected PasswordAuthentication getPasswordAuthentication() { 
    241243            // Special publications user, access to all content, requesting from localhost only 
    242             String pubPass = SUSecurityManager.getInstance().getPubPass(); 
    243             return new PasswordAuthentication(User.PUB_USER_EMAIL, pubPass.toCharArray()); 
     244            return new PasswordAuthentication(User.PUB_USER_EMAIL, passwd); 
    244245        } 
    245246    } 
Note: See TracChangeset for help on using the changeset viewer.