package de.otto.edison.togglz.configuration;


import de.otto.edison.togglz.authentication.LdapAuthenticationFilter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.togglz.console.TogglzConsoleServlet;
import org.togglz.servlet.TogglzFilter;

@Configuration
public class TogglzWebConfiguration {

    @Bean
    @ConditionalOnMissingBean(name = "togglzFilter")
    public FilterRegistrationBean togglzFilter() {
        FilterRegistrationBean filterRegistration = new FilterRegistrationBean();
        filterRegistration.setFilter(new TogglzFilter());
        filterRegistration.addUrlPatterns("/*");
        return filterRegistration;
    }

    @Bean
    @ConditionalOnProperty(prefix = "edison.togglz", name = "ldap-authentication.enabled", havingValue = "true")
    @ConditionalOnMissingBean(name = "togglzAuthenticationFilter")
    public FilterRegistrationBean togglzAuthenticationFilter(@Value("${management.context-path:/internal}") String prefix,
                                                             @Value("${edison.togglz.ldap-authentication.host:}") String host,
                                                             @Value("${edison.togglz.ldap-authentication.port:389}") int port,
                                                             @Value("${edison.togglz.ldap-authentication.base-dn:}") String baseDn,
                                                             @Value("${edison.togglz.ldap-authentication.rdn-identifier:}") String rdnIdentifier) {
        FilterRegistrationBean filterRegistration = new FilterRegistrationBean();
        filterRegistration.setFilter(new LdapAuthenticationFilter(host, port, baseDn, rdnIdentifier));
        filterRegistration.addUrlPatterns(prefix + "/toggles/console");
        return filterRegistration;
    }

    @Bean
    public ServletRegistrationBean togglzServlet(@Value("${management.context-path:/internal}") String prefix) {
        return new ServletRegistrationBean(new TogglzConsoleServlet(), prefix + "/toggles/console/*");
    }


}

@@ -733,16 +733,92 @@
 tion %7B%0A%0A
+    public static final String TOGGLES_URL_PATTERN = %22/toggles/console/*%22;%0A%0A
     @Bea
@@ -2241,26 +2241,27 @@
 x + 
-%22/toggles/console%22
+TOGGLES_URL_PATTERN
 );%0A 
@@ -2504,36 +2504,35 @@
 refix + 
-%22/toggles/console/*%22
+TOGGLES_URL_PATTERN
 );%0A    %7D

Set correct url pattern in FilterRegistrationBean for LdapAuthenticationFilter