Better workaround using GlobalAuthenticationConfigurerAdapter