protected void registerSpringSecurityFilters(Environment environment){

        // try to get spring's internal FilterChainProxy
        Object proxyObject = this.applicationContext.getBean(DEFAULT_FILTER_BEAN_NAME);

        if (null == proxyObject) {
            logger.info("No FilterChainProxy found in the spring container, using default DelegatingFilterProxy");
            environment.servlets().addFilter("/*",DelegatingFilterProxy.class).setInitParameter(DEFAULT_FILTER_BEAN_NAME,DEFAULT_FILTER_BEAN_NAME);
        }
        else {
            FilterChainProxy proxy = (FilterChainProxy) proxyObject;
            logger.info("FilterChainProxy ({}) found, assigning to DelegatingFilterProxy", DEFAULT_FILTER_BEAN_NAME);
            environment.servlets().addFilter("/*",new DelegatingFilterProxy(proxy));
        }
	}