Build fix. Adding deployment authentication service adapter.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14620 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2009-06-10 09:32:54 +00:00
parent 5688516416
commit e3c41b3fb2

View File

@@ -0,0 +1,48 @@
package org.alfresco.repo.deploy;
import org.alfresco.deployment.impl.server.DeploymentReceiverAuthenticator;
import org.alfresco.repo.security.authentication.AuthenticationException;
import org.alfresco.service.cmr.security.AuthenticationService;
/**
* This authenticator uses the Authentication Service to authenticate against the repository.
*
*/
public class DeploymentReceiverAuthenticatorAuthenticationService implements DeploymentReceiverAuthenticator
{
private AuthenticationService authenticationService;
public void init()
{
}
/**
* Are the user and password valid for this deployment receiver?
* @param user
* @param password
* @return true, yes - go ahead.
*/
public boolean logon(String user, String password)
{
try
{
authenticationService.authenticate(user, password.toCharArray());
return true;
}
catch (AuthenticationException e)
{
return false;
}
}
public void setAuthenticationService(AuthenticationService authenticationService) {
this.authenticationService = authenticationService;
}
public AuthenticationService getAuthenticationService() {
return authenticationService;
}
}