Disabled Auth to allow all access to api

This commit is contained in:
Justin xzHome
2024-10-01 11:34:30 +09:00
parent 59078762b5
commit 99ce3731c1

View File

@@ -65,6 +65,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable().cors().and()
.authorizeRequests().anyRequest().permitAll();
/* 주석처리 - 백앤드에 모든 사용자가 접근할수 있도록 ...
http.csrf().disable().cors().and() http.csrf().disable().cors().and()
.sessionManagement() .sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() .sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
@@ -76,9 +80,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.exceptionHandling() .exceptionHandling()
.authenticationEntryPoint(exceptionHandler).and() .authenticationEntryPoint(exceptionHandler).and()
.addFilterBefore(authenticationFilter, UsernamePasswordAuthenticationFilter.class); .addFilterBefore(authenticationFilter, UsernamePasswordAuthenticationFilter.class);
*/
} }
@Bean @Bean
CorsConfigurationSource corsConfigurationSource() { CorsConfigurationSource corsConfigurationSource() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();