- if you make spring boot project with security, default is security on
- Because formLogin method in default springsecurity filter
- we use security filterchain optional by overriding SequrityFilterChain
How to make Optional sequrityFilterChain
- myAccount, myBalance, myLoans, myCards need login and notices, contact is public
- and remove componentscan annotation
- if you use componentscan annotation spring boot scan all component and apply sequrityFilterChain whatever it's authentication is
How to deny all request
http.authorizeHttpRequests((requests) -> requests
.anyRequest().denyAll())
.formLogin(Customizer.withDefaults())
.httpBasic(Customizer.withDefaults());
return http.build();
- and then you can see this page
Hot to accept all request
http.authorizeHttpRequests((requests) -> requests
.anyRequest().permitAll())
.formLogin(Customizer.withDefaults())
.httpBasic(Customizer.withDefaults());
return http.build();