Last active
March 1, 2016 12:42
-
-
Save marcelstoer/c9a894a929c8fe38222a to your computer and use it in GitHub Desktop.
Spring Security logout without CSRF protection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<!-- http://docs.spring.io/spring-security/site/docs/4.0.x/reference/htmlsingle/#filter-stack --> | |
<!-- logout w/o CSRF protection if logout filter is placed before the CSRF filter --> | |
<security:custom-filter before="CSRF_FILTER" ref="logoutFilter" /> | |
</security:http> | |
<bean id="logoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter"> | |
<constructor-arg name="logoutSuccessUrl" value="place-whatever-you-need-here" /> | |
<constructor-arg name="handlers"> | |
<list> | |
<!-- no need to add org.springframework.security.web.csrf.CsrfLogoutHandler --> | |
<bean class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler"/> | |
</list> | |
</constructor-arg> | |
<!-- default logout URL /logout is applied internally --> | |
</bean> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment