Bael 3970 (#9236)
* Manual logout with Spring Security - Basic manual logout - logout with Clear Data Site Header * Add missing annotation for controller. Change mapping URL value. * Add intergration tests for manual logouts. * BAEL-3970 - Add asserts on test. Fix tests names. Remove unused imports. * BAEL-3970 - Use PostMapping annotation. Remove unnecessary information for security configuration. * remove logout controllers * Add multiple entrypoints configurations. Create custom handlers for different logouts (basic, cookie clearing, clear-site-data). * Refactor configuration with lambda DSL. * BAEL-3970 - Remove unnecessary handler for basic logout. Fix integration tests for basic logout.
This commit is contained in:
+2
-7
@@ -39,15 +39,10 @@ public class ManualLogoutIntegrationTest {
|
||||
@Test
|
||||
public void givenLoggedUserWhenUserLogoutThenSessionClearedAndNecessaryCookieCleared() throws Exception {
|
||||
|
||||
MockHttpServletRequest requestStateAfterLogout = this.mockMvc.perform(post("/basic/basiclogout").secure(true).with(csrf()))
|
||||
this.mockMvc.perform(post("/basic/basiclogout").secure(true).with(csrf()))
|
||||
.andExpect(status().is3xxRedirection())
|
||||
.andExpect(unauthenticated())
|
||||
.andExpect(cookie().maxAge(AbstractRememberMeServices.SPRING_SECURITY_REMEMBER_ME_COOKIE_KEY, 0))
|
||||
.andReturn()
|
||||
.getRequest();
|
||||
|
||||
HttpSession sessionStateAfterLogout = requestStateAfterLogout.getSession();
|
||||
assertNull(sessionStateAfterLogout.getAttribute(ATTRIBUTE_NAME));
|
||||
.andReturn();
|
||||
}
|
||||
|
||||
@WithMockUser(value = "spring")
|
||||
|
||||
Reference in New Issue
Block a user