@@ -0,0 +1,3473 @@
+package org.keycloak.adapters.springsecurity.filter;%0A%0Aimport java.io.IOException;%0A%0Aimport javax.servlet.FilterChain;%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.ServletRequest;%0Aimport javax.servlet.ServletResponse;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A/*%0A * Copyright 2016 Red Hat, Inc. and/or its affiliates%0A * and other contributors as indicated by the @author tags.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Aimport org.keycloak.adapters.AdapterDeploymentContext;%0Aimport org.keycloak.adapters.AuthenticatedActionsHandler;%0Aimport org.keycloak.adapters.NodesRegistrationManagement;%0Aimport org.keycloak.adapters.OIDCHttpFacade;%0Aimport org.keycloak.adapters.spi.HttpFacade;%0Aimport org.keycloak.adapters.springsecurity.facade.SimpleHttpFacade;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport org.springframework.beans.BeansException;%0Aimport org.springframework.context.ApplicationContext;%0Aimport org.springframework.context.ApplicationContextAware;%0Aimport org.springframework.web.filter.GenericFilterBean;%0A%0A/**%0A * Exposes a Keycloak adapter %7B@link AuthenticatedActionsHandler%7D as a Spring Security filter.%0A *%0A * @author %3Ca href=%22mailto:srossillo@smartling.com%22%3EScott Rossillo%3C/a%3E%0A * @version $Revision: 1 $%0A */%0Apublic class KeycloakAuthenticatedActionsFilter extends GenericFilterBean implements ApplicationContextAware %7B%0A%0A    private static final Logger log = LoggerFactory.getLogger(KeycloakAuthenticatedActionsFilter.class);%0A%0A    private final NodesRegistrationManagement management = new NodesRegistrationManagement();%0A    private ApplicationContext applicationContext;%0A    private AdapterDeploymentContext deploymentContext;%0A%0A    %0A    public KeycloakAuthenticatedActionsFilter() %7B%0A        super();%0A    %7D%0A%0A    @Override%0A    protected void initFilterBean() throws ServletException %7B%0A        deploymentContext = applicationContext.getBean(AdapterDeploymentContext.class);%0A    %7D%0A%0A    @Override%0A    public void destroy() %7B%0A        log.debug(%22Unregistering deployment%22);%0A        management.stop();%0A    %7D%0A%0A    @Override%0A    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)%0A            throws IOException, ServletException %7B%0A%0A        HttpFacade facade = new SimpleHttpFacade((HttpServletRequest)request, (HttpServletResponse)response);%0A        AuthenticatedActionsHandler handler = new AuthenticatedActionsHandler(deploymentContext.resolveDeployment(facade), (OIDCHttpFacade)facade);%0A        boolean handled = handler.handledRequest();%0A        if (handled) %7B%0A            log.debug(%22Authenticated filter handled request: %7B%7D%22, ((HttpServletRequest) request).getRequestURI());%0A        %7D else %7B%0A            chain.doFilter(request, response);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException %7B%0A        this.applicationContext = applicationContext;%0A    %7D%0A%7D%0A

fix bug https://issues.jboss.org/browse/KEYCLOAK-3474