mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-30 18:15:39 +00:00
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14620 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
49 lines
1.1 KiB
Java
49 lines
1.1 KiB
Java
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;
|
|
}
|
|
|
|
}
|