I have created a CustomRestAuthenticator because for the moment I do not want authentication.
package activiti.extension.rest;
import org.activiti.rest.common.filter.RestAuthenticator;
import org.restlet.Request;
public class CustomRestAuthenticator implements RestAuthenticator {
public boolean requestRequiresAuthentication(Request request) {
return false;
}
public boolean isRequestAuthorized(Request request) {
return false;
}
}
public class NoAuthenticationActivitiRestServicesApplication extends ActivitiRestServicesApplication {
public NoAuthenticationActivitiRestServicesApplication() {
super();
this.setRestAuthenticator(new CustomRestAuthenticator());
}
@Override
public String authenticate(Request request, Response response) {
if (!request.getClientInfo().isAuthenticated()) {
authenticator.challenge(response, false);
return null;
}
return "KERMIT!";
}
}
If I do not override the method authenticate throws a nullpointerexception.