Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- jenkins github 연동
- Docker
- JavaScript
- MySQL
- Jenkins
- grpc
- nginx
- error
- MongoDB
- IntelliJ
- jenkins jdk
- java
- jenkins install
- jenkins github
- Linux
- subnetmask
- spring
- docker network
- jenkins 설치
- grafana
- CI/CD
- 리눅스
- Jenkins Pipeline
- REACT
- vue.js
- jpa
- 리액트
- Spring Boot
- gradle
- jenkins maven
Archives
- Today
- Total
뭐든 즐기면서 ;)
Spring Security 기본 설정 본문
728x90
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.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain;
import static org.springframework.security.config.Customizer.withDefaults;
@Configuration
@EnableWebSecurity
public class SecurityConfig {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.authorizeHttpRequests((authz) -> authz
/**
* TODO
* 필요 시 'authenticated' 추가
* */
//.antMatchers("[/url]").authenticated()
.anyRequest().permitAll()
).httpBasic(withDefaults());
http.csrf().disable();
return http.build();
}
}
728x90
'BACK > Spring Boot & JPA' 카테고리의 다른 글
Spring Boot WebSocket server 구현 기본(HandshakeInterceptor 사용) (0) | 2023.07.19 |
---|---|
Spring boot Error : A problem occurred configuring root project (0) | 2023.05.09 |
Spring Boot + Gradle Multi Module (0) | 2022.11.18 |
JPA persistence.xml / JPA DB설정 (0) | 2021.11.27 |
Spring Boot(Gradle) + MySQL + JPA(Hibernate) [3] - Spring Data JPA 설정 2 (0) | 2021.10.27 |
Comments