mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user