1 17 package org.alfresco.filesys.server.auth; 18 19 import org.alfresco.config.ConfigElement; 20 import org.alfresco.filesys.server.SrvSession; 21 import org.alfresco.filesys.server.config.InvalidConfigurationException; 22 import org.alfresco.filesys.server.config.ServerConfiguration; 23 import org.alfresco.filesys.server.core.SharedDevice; 24 25 32 public class DefaultAuthenticator extends SrvAuthenticator 33 { 34 35 37 private ServerConfiguration m_config; 38 39 42 public DefaultAuthenticator() 43 { 44 setAccessMode(USER_MODE); 45 setEncryptedPasswords(true); 46 } 47 48 57 public int authenticateShareConnect(ClientInfo client, SharedDevice share, String pwd, SrvSession sess) 58 { 59 return Writeable; 60 } 61 62 70 public int authenticateUser(ClientInfo client, SrvSession sess, int alg) 71 { 72 return AUTH_ALLOW; 73 } 74 75 81 public byte[] getChallengeKey(SrvSession sess) 82 { 83 return null; 84 } 85 86 92 public UserAccount getUserDetails(String user) 93 { 94 95 97 UserAccountList userList = m_config.getUserAccounts(); 98 if (userList == null || userList.numberOfUsers() == 0) 99 return null; 100 101 103 return userList.findUser(user); 104 } 105 106 113 public void initialize(ServerConfiguration config, ConfigElement params) throws InvalidConfigurationException 114 { 115 116 118 m_config = config; 119 } 120 } | Popular Tags |