Spring Security – Customize Logout Success Handler

In the tutorial, we will show you how to customize Logout Success Handler with Kotlin Spring Security web application.

I. Technologies

– Apache Maven 3.5.2
– Spring Tool Suite – Version 3.9.0.RELEASE
– Spring Boot – 1.5.10.RELEASE
– Bootstrap

II. Goal

We create a Kotlin MVC Web Application as below:

spring security - customize logout successful handler - project structure

We use LogoutSuccessHandler to customize a behaviour of Kotlin Spring Security after logout successfully. In the tutorial, it will redirect to logoutsuccessful.html page:


III. Implementation

1. Create Kotlin Spring Security web application

-> Follow the article: Spring Security – Configure Spring Security

2. Customize LogoutSuccessHandler
2.1 Create logoutsuccessful.html page

2.2 Customize LogoutSuccessHandler

2.3 Add LogoutSuccessHandler to WebSecurityConfigurer

IV. SourceCode


By grokonez | November 15, 2016.

Last updated on March 8, 2018.

Related Posts

1 thought on “Spring Security – Customize Logout Success Handler”

Got Something To Say:

Your email address will not be published. Required fields are marked *