Closed
Description
Marten Deinum (Migrated from SEC-2620) said:
Trying to configure caching for anything else then the jdbcAuthentication()
is painful. Where ldap caching is easily configured in XML that feature is (currently) not available in Java Config (at least I couldn't find it).
However to make caching configuration easier it would be nice if the CachingUserDetailsService
could be made constructable from outside the package (maybe move to another package?). That way overriding the userDetailsService()
method from the WebSecurityConfigurerAdapter
would allow easy wrapping of the used UserDetailsService
with caching
@Override
protected UserDetailsService userDetailsService() {
UserDetailsService delegate = super.userDetailsService();
CachingUserDetailsService userDetailsService = new CachingUserDetailsService(delegate);
userDetailsService.setUserCache(userCache());
return userDetailsService;
}
That way every UserDetailsService
can be made cacheable without having to expose userCache
methods for each configurer.