November 2017
Intermediate to advanced
542 pages
14h 24m
English
The HttpSecurity configuration of Spring Security automatically adds support for logging the user out. All that is needed is to create a link that points to /j_spring_security_logout. However, we will demonstrate how to customize the URL used to log the user out by performing the following steps:
//src/main/java/com/packtpub/springsecurity/configuration/ SecurityConfig.java http.authorizeRequests() ... .logout() .logoutUrl("/logout") .logoutSuccessUrl("/login?logout");
//src/main/webapp/WEB-INF/templates/fragments/header.html ...
Read now
Unlock full access