Kotlin – 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

– Kotlin 1.2.20
– 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:

Kotlin Spring Security - Customize LogOut Successfully - 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:

Kotlin Spring Security - Customize LogOut Successfully - logout succesfully

III. Implementation

1. Create Kotlin Spring Security web application

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

2. Customize LogoutSuccessHandler
2.1. Create logoutsuccessful.html page

2.2 Customize LogoutSuccessHandler

2.3 Add LogoutSuccessHandler to WebSecurityConfigurer

IV. SourceCode

KotlinSpringSecurityCustomizeLogoutSuccessful

By grokonez | February 15, 2018.



Related Posts


Got Something To Say:

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

*