@@ -0,0 +1,2144 @@
+package org.pac4j.jax.rs.features;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.ws.rs.container.ContainerRequestFilter;%0Aimport javax.ws.rs.core.Context;%0Aimport javax.ws.rs.core.Feature;%0Aimport javax.ws.rs.core.FeatureContext;%0A%0Aimport org.pac4j.core.config.Config;%0Aimport org.pac4j.jax.rs.filter.SecurityFilter;%0A%0A/**%0A * %0A * TODO Normally we would want to inject the request directly in one of the %7B@link ContainerRequestFilter%7D, but%0A * https://java.net/jira/browse/JERSEY-3167 prevents this because we can't make them implement %7B@link Feature%7D. This is%0A * why we need this Feature in order to handle the injection when we want to register a %7B@link SecurityFilter%7D as a%0A * global %7B@link Feature%7D.%0A * %0A * @author vnoel%0A * @since 1.0.0%0A *%0A */%0Apublic class Pac4JSecurityFilterFeature implements Feature %7B%0A%0A    /**%0A     * Note: this is a proxy that is injected and it will map to the correct request during filtering%0A     * %0A     */%0A    @Context%0A    private HttpServletRequest request;%0A%0A    private final Config config;%0A%0A    private final Boolean skipResponse;%0A%0A    private final String authorizers;%0A%0A    private final String clients;%0A%0A    private final String matchers;%0A%0A    private final Boolean multiProfile;%0A%0A    public Pac4JSecurityFilterFeature(Config config) %7B%0A        this(config, null, null, null, null, null);%0A    %7D%0A%0A    public Pac4JSecurityFilterFeature(Config config, Boolean skipResponse, String authorizers, String clients,%0A            String matchers, Boolean multiProfile) %7B%0A        this.config = config;%0A        this.skipResponse = skipResponse;%0A        this.authorizers = authorizers;%0A        this.clients = clients;%0A        this.matchers = matchers;%0A        this.multiProfile = multiProfile;%0A    %7D%0A%0A    @Override%0A    public boolean configure(FeatureContext context) %7B%0A        final SecurityFilter filter = new SecurityFilter(request, config);%0A        filter.setAuthorizers(authorizers);%0A        filter.setClients(clients);%0A        filter.setMatchers(matchers);%0A        filter.setMultiProfile(multiProfile);%0A        filter.setSkipResponse(skipResponse);%0A        context.register(filter);%0A        return true;%0A    %7D%0A%7D%0A

Introduce Feature for using SecurityFilter globally