1 19 package org.openharmonise.rm.security.authentication; 20 21 import java.util.logging.*; 22 23 import org.openharmonise.rm.config.*; 24 25 32 public class UserAuthenticatorFactory { 33 34 private static UserAuthenticator m_auth = null; 35 private static Logger logger = Logger.getLogger(UserAuthenticatorFactory.class.getName()); 36 37 40 public UserAuthenticatorFactory() { 41 super(); 42 } 43 44 49 static public UserAuthenticator getAuthenticator() { 50 51 if(m_auth == null) { 52 try { 53 String crypto = ConfigSettings.getProperty("PWD_ENCRYPTION", "NONE"); 55 if (crypto.equals("NONE")) { 56 m_auth = new UserAuthenticatorImpl(new DefaultPasswordHelper()); 57 } 58 else { 59 m_auth = new UserAuthenticatorImpl(new CryptPasswordHelper(crypto)); 60 } 61 } 62 catch (ConfigException e) { 63 logger.severe(e.getMessage()); 64 } 65 } 66 67 return m_auth; 68 } 69 70 } 71 | Popular Tags |