I updated our webb app to Spring Security 6. The central object for the authentication is the WindowsAuthenticationToken.
It is from here that we get the users name and the WindowsPrincipal object, which we then get the AD-group name from. This is how we get the WindowsAuthenticationToken:
auth = (WindowsAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();
But this no longer works with Spring Security 6, since the Authentication object returned by getAuthentication() is not an instance of WindowsAuthenticationToken. So can we get or create WindowsAuthenticationToken object with Spring Security 6? Our Waffle code is based on this project, but updated to Spring Security 6: https://github.com/mgoldgeier/waffle-spring-boot-demo