grails/grails-spring-security-core

Documentation incorrect - SpringSecurityUtils.clientRegisterFilter does not accept FilterRegistrationBean

Closed this issue · 0 comments

According to the documentation, clientRegisterFilter is supposed to be called with beans of type FilterRegistrationBean, not Filter.

clientRegisterFilter currently only supports beans of type filter and not FilterRegistrationBean

static void clientRegisterFilter(String beanName, int order) {
Filter oldFilter = configuredOrderedFilters.get(order)
assert !oldFilter,
"Cannot register filter '$beanName' at position $order; '$oldFilter' is already registered in that position"
Filter filter = getBean(beanName)
configuredOrderedFilters[order] = filter
List<GrailsSecurityFilterChain> filterChains = getBean('securityFilterChains', List)
mergeFilterChains configuredOrderedFilters, filter, beanName, order, filterChains
log.trace 'Client registered bean "{}" as a filter at order {}', beanName, order
log.trace 'Updated filter chain: {}', filterChains
}