File tree Expand file tree Collapse file tree
investmentservice/src/main/java/com/p2plending/investmentservice/security Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .p2plending .investmentservice .security ;
2+
3+ import lombok .RequiredArgsConstructor ;
4+ import org .springframework .context .annotation .Bean ;
5+ import org .springframework .context .annotation .Configuration ;
6+ import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
7+ import org .springframework .security .web .SecurityFilterChain ;
8+
9+ @ Configuration
10+ @ RequiredArgsConstructor
11+ public class SecurityConfig {
12+
13+ // @Bean
14+ // public JwtAuthenticationFilter jwtAuthenticationFilter() {
15+ // return new JwtAuthenticationFilter(jwtService);
16+ // }
17+
18+ @ Bean
19+ public SecurityFilterChain securityFilterChain (HttpSecurity http ) throws Exception {
20+ http
21+ .csrf (csrf -> csrf .disable ())
22+ // .authorizeHttpRequests(auth -> auth
23+ // .requestMatchers("/api/v1/loans/**").authenticated() // Require JWT here
24+ // .anyRequest().permitAll()
25+ // )
26+ // .authenticationProvider(jwtAuthenticationProvider)
27+ // .addFilterBefore(jwtAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class)
28+ .authorizeHttpRequests (auth -> auth
29+ .anyRequest ().permitAll ()
30+ )
31+ .formLogin (form -> form .disable ())
32+ .httpBasic (httpBasic -> httpBasic .disable ());
33+ return http .build ();
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments