Package org.alfresco.filesys.auth.cifs
Class CifsAuthenticatorBase
- java.lang.Object
-
- org.alfresco.jlan.server.auth.CifsAuthenticator
-
- org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase
-
- All Implemented Interfaces:
org.alfresco.jlan.server.auth.ICifsAuthenticator,ActivateableBean,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
AlfrescoCifsAuthenticator,EnterpriseCifsAuthenticator,PassthruCifsAuthenticator
public abstract class CifsAuthenticatorBase extends org.alfresco.jlan.server.auth.CifsAuthenticator implements ActivateableBean, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
CIFS Authenticator Base ClassBase class for Alfresco CIFS authenticator implementations.
- Author:
- gkspencer
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Logloggerprotected MD4PasswordEncoderm_md4EncoderThe m_md4 encoder.-
Fields inherited from class org.alfresco.jlan.server.auth.CifsAuthenticator
GUEST_USERNAME, m_config, m_random
-
Fields inherited from interface org.alfresco.jlan.server.auth.ICifsAuthenticator
AUTH_ACCDISABLED, AUTH_ALLOW, AUTH_BADPASSWORD, AUTH_BADUSER, AUTH_DISALLOW, AUTH_GUEST, AUTH_PASSEXPIRED, LANMAN, NoAccess, NTLM1, NTLM2, ReadOnly, SHARE_MODE, STANDARD_CHALLENGE_LEN, STANDARD_PASSWORD_LEN, USER_MODE, Writeable
-
-
Constructor Summary
Constructors Constructor Description CifsAuthenticatorBase()Instantiates a new cifs authenticator base.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected voidcheckForAdminUserName(org.alfresco.jlan.server.auth.ClientInfo cInfo)Check if the user is an administrator user name.voiddestroy()Handle tidy up on container shutdown.protected voiddoGuestLogon(org.alfresco.jlan.server.auth.ClientInfo client, org.alfresco.jlan.server.SrvSession sess)Logon using the guest user account.protected <T> TdoInTransaction(RetryingTransactionHelper.RetryingTransactionCallback<T> callback)Does work in a transaction.protected AuthenticationComponentgetAuthenticationComponent()Return the authentication component.protected AuthenticationServicegetAuthenticationService()Return the authentication service.protected AuthorityServicegetAuthorityService()Return the authority service.protected voidgetHomeFolderForUser(org.alfresco.jlan.server.auth.ClientInfo client)Get the home folder for the user.protected org.alfresco.service.cmr.repository.NodeServicegetNodeService()Return the node service.protected NLTMAuthenticatorgetNTLMAuthenticator()Returns an SSO-enabled authentication component.protected PersonServicegetPersonService()Return the person service.voidinitialize()Initialize the authenticator.voidinitialize(org.alfresco.jlan.server.config.ServerConfiguration config, org.springframework.extensions.config.ConfigElement params)Initialize the authenticator.booleanisActive()Determines whether this bean is active.java.lang.StringmapUserNameToPerson(java.lang.String userName, boolean checkEnabled)Map the case insensitive logon name to the internal person object user name.voidsetActive(boolean active)Activates or deactivates the bean.voidsetAuthenticationComponent(AuthenticationComponent authenticationComponent)Sets the authentication component.voidsetAuthenticationService(AuthenticationService authenticationService)Sets the authentication service.voidsetAuthorityService(AuthorityService authorityService)Sets the authority service.voidsetCurrentUser(org.alfresco.jlan.server.auth.ClientInfo client)Set the current authenticated user context for this thread.voidsetDiskInterface(org.alfresco.jlan.server.filesys.DiskInterface diskInterface)Set the filesystem driver for the node service based filesystem.voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)Sets the node service.voidsetPersonService(PersonService personService)Sets the person service.voidsetTransactionService(TransactionService transactionService)Sets the transaction service.protected booleanvalidateAuthenticationMode()Validate that the authentication component supports the required mode.-
Methods inherited from class org.alfresco.jlan.server.auth.CifsAuthenticator
allowGuest, authenticateShareConnect, authenticateUser, authenticateUserPlainText, closeAuthenticator, convertPassword, generateEncryptedPassword, generateNegotiateResponse, getAccessMode, getAuthContext, getCIFSConfig, getEnabledDialects, getEncryptionKeyLength, getEncryptor, getGuestUserName, getsecurityConfig, getSecurityMode, getServerCapabilities, getStatusAsString, getUserDetails, hasDebug, hasExtendedSecurity, hasSessionCleanup, mapClientAddressToDomain, mapUnknownUserToGuest, processSessionSetup, setAccessMode, setAllowGuest, setConfig, setDebug, setExtendedSecurity, setGuestUserName, setMapToGuest, setSecurityMode, setSessionCleanup, toString, validatePassword
-
-
-
-
Field Detail
-
logger
protected static final org.apache.commons.logging.Log logger
-
m_md4Encoder
protected MD4PasswordEncoder m_md4Encoder
The m_md4 encoder.
-
-
Method Detail
-
setAuthenticationComponent
public void setAuthenticationComponent(AuthenticationComponent authenticationComponent)
Sets the authentication component.- Parameters:
authenticationComponent- the authenticationComponent to set
-
setAuthenticationService
public void setAuthenticationService(AuthenticationService authenticationService)
Sets the authentication service.- Parameters:
authenticationService- the authenticationService to set
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Sets the node service.- Parameters:
nodeService- the nodeService to set
-
setPersonService
public void setPersonService(PersonService personService)
Sets the person service.- Parameters:
personService- the personService to set
-
setTransactionService
public void setTransactionService(TransactionService transactionService)
Sets the transaction service.- Parameters:
transactionService- the transactionService to set
-
setAuthorityService
public void setAuthorityService(AuthorityService authorityService)
Sets the authority service.- Parameters:
authorityService- the authorityService to set
-
setDiskInterface
public void setDiskInterface(org.alfresco.jlan.server.filesys.DiskInterface diskInterface)
Set the filesystem driver for the node service based filesystem.- Parameters:
diskInterface- DiskInterface
-
isActive
public boolean isActive()
Description copied from interface:ActivateableBeanDetermines whether this bean is active.- Specified by:
isActivein interfaceActivateableBean- Returns:
trueif this bean is active
-
setActive
public void setActive(boolean active)
Activates or deactivates the bean.- Parameters:
active-trueif the bean is active and initialization should complete
-
initialize
public void initialize(org.alfresco.jlan.server.config.ServerConfiguration config, org.springframework.extensions.config.ConfigElement params) throws org.alfresco.jlan.server.config.InvalidConfigurationExceptionInitialize the authenticator.- Overrides:
initializein classorg.alfresco.jlan.server.auth.CifsAuthenticator- Parameters:
config- ServerConfigurationparams- ConfigElement- Throws:
org.alfresco.jlan.server.config.InvalidConfigurationException- the invalid configuration exceptionorg.alfresco.jlan.server.config.InvalidConfigurationException
-
initialize
public void initialize() throws org.alfresco.jlan.server.config.InvalidConfigurationExceptionInitialize the authenticator.- Overrides:
initializein classorg.alfresco.jlan.server.auth.CifsAuthenticator- Throws:
org.alfresco.jlan.server.config.InvalidConfigurationException- the invalid configuration exceptionorg.alfresco.jlan.server.config.InvalidConfigurationException
-
afterPropertiesSet
public final void afterPropertiesSet() throws org.alfresco.jlan.server.config.InvalidConfigurationException- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
org.alfresco.jlan.server.config.InvalidConfigurationException
-
validateAuthenticationMode
protected boolean validateAuthenticationMode()
Validate that the authentication component supports the required mode.- Returns:
- boolean
-
doGuestLogon
protected void doGuestLogon(org.alfresco.jlan.server.auth.ClientInfo client, org.alfresco.jlan.server.SrvSession sess)Logon using the guest user account.- Overrides:
doGuestLogonin classorg.alfresco.jlan.server.auth.CifsAuthenticator- Parameters:
client- ClientInfosess- SrvSession
-
getHomeFolderForUser
protected final void getHomeFolderForUser(org.alfresco.jlan.server.auth.ClientInfo client)
Get the home folder for the user.- Parameters:
client- ClientInfo
-
mapUserNameToPerson
public final java.lang.String mapUserNameToPerson(java.lang.String userName, boolean checkEnabled)Map the case insensitive logon name to the internal person object user name. And optionally check whether the user is enabled.- Parameters:
userName- StringcheckEnabled-- Returns:
- the user name
-
setCurrentUser
public void setCurrentUser(org.alfresco.jlan.server.auth.ClientInfo client)
Set the current authenticated user context for this thread.- Specified by:
setCurrentUserin interfaceorg.alfresco.jlan.server.auth.ICifsAuthenticator- Overrides:
setCurrentUserin classorg.alfresco.jlan.server.auth.CifsAuthenticator- Parameters:
client- ClientInfo or null to clear the context
-
getAuthenticationComponent
protected final AuthenticationComponent getAuthenticationComponent()
Return the authentication component.- Returns:
- AuthenticationComponent
-
getNTLMAuthenticator
protected final NLTMAuthenticator getNTLMAuthenticator()
Returns an SSO-enabled authentication component.- Returns:
- NLTMAuthenticator
-
getAuthenticationService
protected final AuthenticationService getAuthenticationService()
Return the authentication service.- Returns:
- AuthenticationService
-
getNodeService
protected final org.alfresco.service.cmr.repository.NodeService getNodeService()
Return the node service.- Returns:
- NodeService
-
getPersonService
protected final PersonService getPersonService()
Return the person service.- Returns:
- PersonService
-
getAuthorityService
protected final AuthorityService getAuthorityService()
Return the authority service.- Returns:
- AuthorityService
-
checkForAdminUserName
protected final void checkForAdminUserName(org.alfresco.jlan.server.auth.ClientInfo cInfo)
Check if the user is an administrator user name.- Parameters:
cInfo- ClientInfo
-
doInTransaction
protected <T> T doInTransaction(RetryingTransactionHelper.RetryingTransactionCallback<T> callback)
Does work in a transaction. This will be a writeable transaction unless the system is in read-only mode.- Parameters:
callback- a callback that does the work- Returns:
- the result, or
nullif not applicable
-
destroy
public void destroy() throws java.lang.ExceptionHandle tidy up on container shutdown.- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
java.lang.Exception- the exception
-
-