Added checks to the file server configuration bean initialization to check that the configured

authenticator matches the authentication component NTLM mode.
Updated authenticator base class required for passthru changes.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2479 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2006-02-23 13:59:50 +00:00
parent f737be201b
commit 6fac2e9b25
3 changed files with 46 additions and 5 deletions

View File

@@ -47,6 +47,21 @@ public class AlfrescoAuthenticator extends SrvAuthenticator
setEncryptedPasswords(true);
}
/**
* Validate that the authentication component supports the required mode
*
* @return boolean
*/
protected boolean validateAuthenticationMode()
{
// Make sure the authentication component supports MD4 hashed passwords or passthru mode
if ( m_authComponent.getNTLMMode() != NTLMMode.MD4_PROVIDER &&
m_authComponent.getNTLMMode() != NTLMMode.PASS_THROUGH)
return false;
return true;
}
/**
* Authenticate a user
*

View File

@@ -228,10 +228,6 @@ public abstract class SrvAuthenticator
if ( m_authComponent == null)
throw new InvalidConfigurationException("Authentication component not available");
if ( m_authComponent.getNTLMMode() != NTLMMode.MD4_PROVIDER &&
m_authComponent.getNTLMMode() != NTLMMode.PASS_THROUGH)
throw new InvalidConfigurationException("Required authentication mode not available");
// Get hold of various services
m_nodeService = config.getNodeService();
@@ -242,8 +238,23 @@ public abstract class SrvAuthenticator
// Set the guest user name
setGuestUserName( m_authComponent.getGuestUserName());
// Check that the authentication component is the required type for this authenticator
if ( validateAuthenticationMode() == false)
throw new InvalidConfigurationException("Required authentication mode not available");
}
/**
* Validate that the authentication component supports the required mode
*
* @return boolean
*/
protected boolean validateAuthenticationMode()
{
return true;
}
/**
* Encrypt the plain text password with the specified encryption key using the specified
* encryption algorithm.