Forward port of https://github.com/spring-projects/spring-security/issues/11888

Comment From: jzheaux

Closed in dd30694979f0b253ed78a54667982e6f8ebe2d4e