See https://github.com/spring-projects/spring-security/pull/10614#issuecomment-1013536988