diff --git a/source/java/org/alfresco/repo/deploy/DeploymentReceiverAuthenticatorAuthenticationService.java b/source/java/org/alfresco/repo/deploy/DeploymentReceiverAuthenticatorAuthenticationService.java new file mode 100644 index 0000000000..665da10f4c --- /dev/null +++ b/source/java/org/alfresco/repo/deploy/DeploymentReceiverAuthenticatorAuthenticationService.java @@ -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; + } + +}