I am afraid that there is no obvious way to get it.
But all the examples from the Spring-Security Security reference guide are consistent with this: you donβt even want to get it: everyone displays the explicit SessionAuthenticationStrategy entered in UserNamePasswordAuthenticationFilter and, if necessary, in SessionManagementFilter .
According to the javadocs of these two classes, the default SessionAuthenticationStrategy :
SessionFixationProtectionStrategy for Servlet <3.1ChangeSessionIdAuthenticationStrategy for Servlet 3.1 +
So the right way is to create a bean of the SessionAuthenticationStrategy implementation SessionAuthenticationStrategy either one of the defaults above, or another if you have special needs, and use it where you need it.
Of course, you can always use reflection to access the private members of the Spring Security implementation classes, but you know that this is bad and could be compromised in the next version of Spring security.
source share