Commit fc064b25 by Patryk Czarnik

SecurityConfig z regułą permitAll

parent d28a09e5
package sklep.security;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.SecurityFilterChain;
@Configuration
public class SecurityConfig {
// W klasie typu Configuration umieszczamy metody, które w wyniku zwracają obiekty, które dla Springa coś specjalnego znaczą.
// Te metody oznaczamy adnotacją @Bean.
// (w ten sposób można też stworzyć "własne" beany, zamiast podejścia z adnotacją @Component)
@Bean
SecurityFilterChain setHttpSecurity(HttpSecurity httpSecurity) throws Exception {
httpSecurity.authorizeRequests()
.anyRequest().permitAll();
return httpSecurity.build();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment