Update to Spring Security `6.5.0-M2`. Related gh-1897 and commit b556d19bcf5e04063a937dd9998ccdf6715cd4de