How to get Waffle to work with Spring Security 6?

132 views
Skip to first unread message

Mobile Visuals

unread,
Oct 22, 2024, 7:42:36 AM10/22/24
to waffle

I updated a system to Spring Security 6. Authentication is fetched with

authentication =SecurityContextHolder.getContext().getAuthentication();

But after the update to Spring Security 6, this authentication object is no longer an instance of WindowsAuthenticationToken. It needs to be a WindowsAuthenticationToken to get the name of the user. So how can I get Waffle to work with Spring Security 6?

Jeremy Landis

unread,
Oct 22, 2024, 3:26:00 PM10/22/24
to waffle
It works fine with spring 6, make sure you are using the spring 6 module and the waffle-jakarta item.  If you still believe an issue, please try to contribute on the project.  It has demos for spring 6 as well as spring boot 3.  This has all been supported for a couple years now.

Mobile Visuals

unread,
Oct 24, 2024, 2:06:20 PM10/24/24
to waffle
It works in one of our webb apps now, but not in the other. I debugged the source code for Waffle and found the reason: NegotiateSecurityFilter is created, but doFilter() is never called, so the WindowsPrincipal is never created.
But I have not found a way to solve it.

Mobile Visuals

unread,
Oct 29, 2024, 9:26:21 AM10/29/24
to waffle
I could solve a small part of this problem so doFilter() is called, but the WindowsPrincipal is not created. I have reported an issue on this here: 
Reply all
Reply to author
Forward
0 new messages