use of org.keycloak.adapters.springsecurity.filter.KeycloakPreAuthActionsFilter in project vboard by voyages-sncf-technologies.
the class WebSecurityConfig method configureKeycloakSecurity.
protected void configureKeycloakSecurity(HttpSecurity http) throws Exception {
// Not @Autowiring those beans as they may not be available because of the @Conditional
final AdapterDeploymentContext adc = applicationContext.getBean(AdapterDeploymentContext.class);
final KeycloakPreAuthActionsFilter keycloakPreAuthActionsFilter = applicationContext.getBean(KeycloakPreAuthActionsFilter.class);
http.addFilterBefore(keycloakPreAuthActionsFilter, LogoutFilter.class).addFilterBefore(keycloakAuthenticationProcessingFilter(), BasicAuthenticationFilter.class).exceptionHandling().authenticationEntryPoint(new KeycloakAuthenticationEntryPoint(adc));
http.logout().addLogoutHandler(new KeycloakLogoutHandler(adc)).logoutUrl("/sso/logout").permitAll().logoutSuccessUrl("/");
}
Aggregations