@Bean DigestAuthenticationFilter digestFilter(DigestAuthenticationEntryPoint digestAuthenticationEntryPoint, UserCache digestUserCache, UserDetailsService userDetailsService) { DigestAuthenticationFilter filter = new DigestAuthenticationFilter(); filter.setAuthenticationEntryPoint(digestAuthenticationEntryPoint); filter.setUserDetailsService(userDetailsService); filter.setUserCache(digestUserCache); return filter; }
@Override protected void configure(HttpSecurity http) throws Exception { http.antMatcher("/**") .authorizeRequests().antMatchers("/", "/login**", "/webjars**").permitAll().anyRequest().authenticated().and() .exceptionHandling()/*.authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/login"))*/.and() .logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout")).logoutSuccessUrl("/").permitAll().and() .csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()).and() .addFilterBefore(this.ssoFilter(), DigestAuthenticationFilter.class) .headers().httpStrictTransportSecurity().disable().and() .requestCache().requestCache(new NullRequestCache()).and() ; }
@Bean public DigestAuthenticationFilter digestAuthFilter(DigestAuthenticationEntryPoint entryPoint, UserDetailsService userDetailsService) { DigestAuthenticationFilter filter = new DigestAuthenticationFilter(); filter.setUserDetailsService(userDetailsService); filter.setAuthenticationEntryPoint(entryPoint); return filter; }