Backport of https://github.com/spring-projects/spring-security/issues/7658

Comment From: jzheaux

Fixed via cd0bec48deb4e171648b00bcf0cebf14d0b15fdb