internal API plus brute force security

This commit is contained in:
Anthony Stirling
2023-12-24 17:12:32 +00:00
parent 120b017b1a
commit 2f5d7ed712
9 changed files with 149 additions and 12 deletions

View File

@@ -41,9 +41,13 @@ public class SecurityConfiguration {
@Autowired
private UserAuthenticationFilter userAuthenticationFilter;
@Autowired
private FirstLoginFilter firstLoginFilter;
private CustomAuthenticationSuccessHandler customAuthenticationSuccessHandler;
@Autowired
private LoginAttemptService loginAttemptService;
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
@@ -57,9 +61,9 @@ public class SecurityConfiguration {
http
.formLogin(formLogin -> formLogin
.loginPage("/login")
.successHandler(customAuthenticationSuccessHandler)
// .defaultSuccessUrl("/")
.successHandler(new SavedRequestAwareAuthenticationSuccessHandler())
.failureHandler(new CustomAuthenticationFailureHandler())
.failureHandler(new CustomAuthenticationFailureHandler(loginAttemptService))
.permitAll()
)
.logout(logout -> logout
@@ -87,6 +91,8 @@ public class SecurityConfiguration {
}
return http.build();
}
@Bean