Yes, multiple implementations are supported. Note that each will be invoked (in no specific order) so you will need to have each implementation only process the applicable logins.
e.g. Suppose you want to have two websites in AEM protected by two distinct postProcess
implementations. Consider something like this:
public abstract class AbstractAuthenticationPostProcessor implements AuthenticationInfoPostProcessor {
protected PostProcessorHandler getHandler(HttpServletRequest request) {
String path = request.getRequestURI();
if (path.startsWith("/content/siteA") {
return PostProcessorHandler.SiteA;
}
if (path.startsWith("/content/siteB") {
return PostProcessorHandler.SiteB;
}
return PostProcessorHandler.None
}
protected enum PostProcessorHandler {
SiteA,
SiteB,
None
}
}
Then in each of the implementations of the postprocessors do this:
public class SiteAPostProcessor extends AbstractAuthenticationPostProcessor {
@Override
public void postProcess(
AuthenticationInfo authenticationInfo,
HttpServletRequest request,
HttpServletResponse response) {
if (getHandler(request) != AuthenticationHandler.SiteA) {
return;
}
// do post login tasks
}
}