I am trying to use a customized authentication implementation on 7.2.2. However, I fail to open login page which gives me 500 error and say my implementation class does not exists.
Here are the steps of my work so far:
- Implemented a new jar package with below code:
`package com.synale.BonitaAuthentication;
import java.io.Serializable;
import java.util.Map;
import org.bonitasoft.engine.authentication.AuthenticationConstants;
import org.bonitasoft.engine.authentication.AuthenticationException;
import org.bonitasoft.engine.authentication.GenericAuthenticationService;
import org.bonitasoft.engine.commons.LogUtil;
import org.bonitasoft.engine.identity.IdentityService;
import org.bonitasoft.engine.log.technical.TechnicalLogSeverity;
import org.bonitasoft.engine.log.technical.TechnicalLoggerService;
public class SimpleAuthenticationServiceImpl implements GenericAuthenticationService {
private final IdentityService identityService;
private final TechnicalLoggerService logger;
public SimpleAuthenticationServiceImpl(final IdentityService identityService, final TechnicalLoggerService logger) {
this.identityService = identityService;
this.logger = logger;
}
public String checkUserCredentials(Map<String, Serializable> credentials) throws AuthenticationException {
// TODO Auto-generated method stub
final String methodName = "checkUserCredentials";
try {
final String password = String.valueOf(credentials.get(AuthenticationConstants.BASIC_PASSWORD));
final String userName = String.valueOf(credentials.get(AuthenticationConstants.BASIC_USERNAME));
if(userName.equals(password))
return userName;
} catch (final Exception sunfe) {
if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) {
logger.log(this.getClass(), TechnicalLogSeverity.TRACE, LogUtil.getLogOnExceptionMethod(this.getClass(), methodName, sunfe));
}
}
return null;
}
}
`
-
Copy compiled jar file to /webapps/bonita/WEB-INF/lib
-
Updated auth.AuthenticationManager in configuration file /client/tenants/1/conf/authenticationManager-config.properties, and give the class name “com.synale.BonitaAuthentication.SimpleAuthenticationServiceImpl”
-
Updated “
<bean id="authenticationService">
” in configuration file /engine-server/work/tenants/1/bonita-tenant-community.xml, and bind to class “com.synale.BonitaAuthentication.SimpleAuthenticationServiceImpl”
May I know what else are still missing?