@Override
public Handler decorate(Injector injector, Handler handler) {
final String callbackPath = getCallbackPath(injector);
final Client<C, U> client = getClient(injector);
final Authorizer authorizer = getAuthorizer(injector);
final Pac4jClientsHandler clientsHandler = new Pac4jClientsHandler(callbackPath, client);
final Handler callbackHandler = new Pac4jCallbackHandlerBuilder().build();
final Pac4jAuthenticationHandler authenticationHandler = new Pac4jAuthenticationHandler(client.getName(), authorizer);
return Handlers.chain(clientsHandler, Handlers.path(callbackPath, callbackHandler), authenticationHandler, handler);
}