Skip to content

Commit 6a51097

Browse files
committed
Disabled spring security
1 parent ef5bf24 commit 6a51097

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
}

0 commit comments

Comments
 (0)