private void registerDefaultLogoutSuccessHandler(B http, RequestMatcher preferredMatcher) { LogoutConfigurer<B> logout = http .getConfigurer(LogoutConfigurer.class); if (logout == null) { return; } LogoutConfigurer<B> handler = logout.defaultLogoutSuccessHandlerFor( postProcess(new HttpStatusReturningLogoutSuccessHandler(HttpStatus.NO_CONTENT)), preferredMatcher); }
.logout() .logoutUrl("/api/v1/logout") .logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler()) .invalidateHttpSession(true) .deleteCookies("JSESSIONID", knoxCookie);
private void registerDefaultLogoutSuccessHandler(B http, RequestMatcher preferredMatcher) { LogoutConfigurer<B> logout = http .getConfigurer(LogoutConfigurer.class); if (logout == null) { return; } LogoutConfigurer<B> handler = logout.defaultLogoutSuccessHandlerFor( postProcess(new HttpStatusReturningLogoutSuccessHandler(HttpStatus.NO_CONTENT)), preferredMatcher); }
@Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED) .and() .requestMatchers().antMatchers("/**") .and().authorizeRequests() .antMatchers("/**").permitAll() .anyRequest().authenticated() .and().formLogin().permitAll() .and().logout() .logoutUrl("/logout") .logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler()) .addLogoutHandler(customLogoutHandler()); }
private void registerDefaultLogoutSuccessHandler(B http, RequestMatcher preferredMatcher) { LogoutConfigurer<B> logout = http .getConfigurer(LogoutConfigurer.class); if (logout == null) { return; } LogoutConfigurer<B> handler = logout.defaultLogoutSuccessHandlerFor( postProcess(new HttpStatusReturningLogoutSuccessHandler(HttpStatus.NO_CONTENT)), preferredMatcher); }
@Override public void configure(HttpSecurity http) throws Exception { http.csrf().disable() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS) .and() .requestMatchers().antMatchers("/**") .and().authorizeRequests() .antMatchers("/**").permitAll() .anyRequest().authenticated() .and().logout() .logoutUrl("/logout") .clearAuthentication(true) .logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler()) .addLogoutHandler(customLogoutHandler()); //http.antMatcher("/api/**").addFilterAt(customSecurityFilter(), FilterSecurityInterceptor.class); }
.deleteCookies(COOKIES_TO_DELETE) .logoutUrl(WEB_URI_PREFIX + "logout") .logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler(HttpStatus.OK)) .and() .exceptionHandling()
.logoutUrl(dashboard(this.authorizationProperties.getLogoutUrl())) .logoutSuccessUrl(dashboard(this.authorizationProperties.getLogoutSuccessUrl())) .logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler()).permitAll().and().httpBasic().and() .exceptionHandling() .defaultAuthenticationEntryPointFor(new LoginUrlAuthenticationEntryPoint(loginPage), textHtmlMatcher)