@SuppressWarnings("ProhibitedExceptionDeclared") @Override protected void configure(final HttpSecurity http) throws Exception { final AuthenticationEntryPoint ssoEntryPoint = new SsoAuthenticationEntryPoint(SsoController.SSO_PAGE); final SsoAuthenticationFilter<?> ssoAuthenticationFilter = new SsoAuthenticationFilter<>(SsoController.SSO_AUTHENTICATION_URI, EntityType.CombinedSso.INSTANCE); ssoAuthenticationFilter.setAuthenticationManager(authenticationManager()); final LogoutSuccessHandler logoutSuccessHandler = new HodTokenLogoutSuccessHandler(SsoController.SSO_LOGOUT_PAGE, tokenRepository); http.regexMatcher("/public(/.*)?|/sso|/authenticate-sso|/api/authentication/.*|/logout") .csrf() .disable() .exceptionHandling() .authenticationEntryPoint(ssoEntryPoint) .accessDeniedPage(DispatcherServletConfiguration.AUTHENTICATION_ERROR_PATH) .and() .authorizeRequests() .antMatchers(FindController.APP_PATH + "/**").hasRole(FindRole.USER.name()) .and() .logout() .logoutSuccessHandler(logoutSuccessHandler) .and() .addFilterAfter(ssoAuthenticationFilter, AbstractPreAuthenticatedProcessingFilter.class); }
protected LogoutSuccessHandler logoutSuccessHandler() { return new LogoutSuccessHandler() { @Override public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { response.getWriter().append("OK"); response.setStatus(200); } }; }
/** * Logout success handler, removing cookie auth * * @return */ @Bean public LogoutSuccessHandler logoutSuccessHandler() { return (HttpServletRequest request, HttpServletResponse response, Authentication authentication) -> { if (authentication != null && authentication.getPrincipal() != null) { LOG.info("LOGOUT >>> " + authentication.getPrincipal()); } else { LOG.info("LOGOUT >>> called without authentication"); } apiAuth.remove(request, response); response.setStatus(HttpServletResponse.SC_OK); response.getWriter().flush(); }; }
@Bean(name = "dashboardLogoutSuccessHandler") public LogoutSuccessHandler dashboardLogoutSuccessHandler() { final SimpleUrlLogoutSuccessHandler logoutSuccessHandler = new SimpleUrlLogoutSuccessHandler(); logoutSuccessHandler.setRedirectStrategy(new DashboardLogoutRedirectStrategy(logoutUrl)); return logoutSuccessHandler; }
@Bean public LogoutSuccessHandler ajaxLogoutSuccessHandler() { return (request, response, authentication) -> { response.setStatus(HttpServletResponse.SC_OK); response.flushBuffer(); }; }
@Bean public LogoutSuccessHandler casLogoutSuccessHandler() { CasLogoutSuccessHandler handler = new CasLogoutSuccessHandler(); handler.setCasUrl(casUrl); handler.setDefaultTarget(rootUrl); return handler; }
@Bean public LogoutSuccessHandler logoutSuccessHandler() { return new LogoutSuccessHandlerImpl(); }
@Bean public LogoutSuccessHandler logoutSuccessHandler() { return (request, response, authentication) -> response.setStatus(HttpServletResponse.SC_OK); }
@Bean public LogoutSuccessHandler logoutSuccessHandlerImpl() { return new LogoutSuccessHandlerRestImpl(); }
@Bean public LogoutSuccessHandler logoutSuccessHandler() { return new CustomLogoutSuccessHandler(); }
public PentahoSamlLogoutFilter( LogoutSuccessHandler logoutSuccessHandler, LogoutHandler[] localHandler, LogoutHandler[] globalHandlers ) { super( logoutSuccessHandler, localHandler, globalHandlers ); }
public PentahoSamlLogoutProcessingFilter( LogoutSuccessHandler logoutSuccessHandler, LogoutHandler... handlers ) { super( logoutSuccessHandler, handlers ); }
public void setDelegate(LogoutSuccessHandler delegate) { this.delegate = delegate; }
@Bean public LogoutSuccessHandler logoutSuccessHandler() { return new AjaxLogoutSuccessHandler(); }
@Autowired public void configureGlobal(AuthenticationManagerBuilder auth, AuthManager authManager, LogoutSuccessHandler logoutSuccessHandler) throws Exception { this.logoutSuccessHandler = logoutSuccessHandler; auth.authenticationProvider(new LaunchKeyAuthenticationProvider(authManager)); }
/** * Handler to be invoked upon successful logout. Overrides value set by {@link #defaultTargetURL(String)}. * * @param handler the handler to invoke upon successful logout. * @return this configurer for further customization */ public LogoutConfigurer successHandler(LogoutSuccessHandler handler) { successHandler = handler; return this; }
/** * Constructor. * * @param logoutSuccessHandler * The logout success handler. * @param handlers * The handlers. */ public CommunoteLogoutFilter(LogoutSuccessHandler logoutSuccessHandler, LogoutHandler[] handlers) { super(logoutSuccessHandler, handlers); }