Forward port of #13860
Comment From: marcusdacoregio
Closed via https://github.com/spring-projects/spring-security/commit/e916e44a5e042da8f7603708e96930f3176acfaf
Forward port of #13860
Comment From: marcusdacoregio
Closed via https://github.com/spring-projects/spring-security/commit/e916e44a5e042da8f7603708e96930f3176acfaf