Advertisement
andersonalmada2

Untitled

Aug 2nd, 2022
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. package br.ufc.mandacaru5.config.security;
  2.  
  3. import org.springframework.context.annotation.Bean;
  4. import org.springframework.security.config.annotation.web.builders.HttpSecurity;
  5. import org.springframework.security.web.SecurityFilterChain;
  6. import org.springframework.stereotype.Component;
  7.  
  8. @Component
  9. public class WebSecurityConfig {
  10.  
  11.     @Bean
  12.     public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
  13.         http.httpBasic().and().authorizeHttpRequests().anyRequest().authenticated().and().csrf().disable();
  14.  
  15.         return http.build();
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement