/*
 * Copyright (c) 2012-2017 Red Hat, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Red Hat, Inc. - initial API and implementation
 */
package org.eclipse.che.multiuser.keycloak.server.deploy;

import com.google.inject.servlet.ServletModule;
import javax.inject.Singleton;
import org.eclipse.che.multiuser.keycloak.server.KeycloakAuthenticationFilter;
import org.eclipse.che.multiuser.keycloak.server.KeycloakEnvironmentInitalizationFilter;

public class KeycloakServletModule extends ServletModule {
  @Override
  protected void configureServlets() {
    bind(KeycloakAuthenticationFilter.class).in(Singleton.class);

    // Not contains '/websocket', /docs/ (for swagger) and not ends with '/ws' or '/eventbus' or '/settings/'
    filterRegex(
            "^(?!.*(/websocket/?|/docs/))(?!.*(/ws/?|/eventbus/?|/settings/?|/api/oauth/callback/?)$).*")
        .through(KeycloakAuthenticationFilter.class);
    filterRegex(
            "^(?!.*(/websocket/?|/docs/))(?!.*(/ws/?|/eventbus/?|/settings/?|/api/oauth/callback/?)$).*")
        .through(KeycloakEnvironmentInitalizationFilter.class);
  }
}

@@ -866,22 +866,8 @@
 ains
- '/websocket',
  /do
@@ -908,125 +908,108 @@
 h '/
-ws' or '/eventbus' or '/settings/'%0A    filterRegex(%0A            %22%5E(?!.*(/websocket/?%7C/docs/))(?!.*(/ws/?%7C/eventbus/?%7C
+api/oauth/callback/' or%0A    // '/keycloak/settings/'%0A    filterRegex(%22%5E(?!.*(/docs/))(?!.*(/keycloak
 /set
@@ -1119,74 +1119,39 @@
 gex(
-%0A            %22%5E(?!.*(/websocket/?%7C/docs/))(?!.*(/ws/?%7C/eventbus/?%7C
+%22%5E(?!.*(/docs/))(?!.*(/keycloak
 /set

Remove '/ws' and '/websocket' parts from KeycloakAuthenticationFilter binding