Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- docker
- sapfiorielements
- intellijIDEA
- maven
- dbeaver
- mybatis
- NCP
- Git
- gradle
- Windows
- LOG4J
- Kubernetes
- log4j2
- react
- MySQL
- Spring
- gson
- Linux
- JavaScript
- database
- BPMN
- nginx
- tibero
- VSCode
- JPA
- IntelliJ
- springboot
- Java
- useEffect
- nodejs
Archives
- Today
- Total
두 손끝의 창조자
[Spring-Security]HttpSecurity 본문
HttpSecurity는 네임 스페이스 구성에있는 Spring Security의 XML <http> 요소와 유사합니다. 특정 http 요청에 대해 웹 기반 보안을 구성 할 수 있습니다. 기본적으로 모든 요청에 적용되지만 requestMatcher (RequestMatcher) 또는 기타 유사한 메소드를 사용하여 제한 할 수 있습니다.
@Configuration
@EnableWebSecurity
public class FormLoginSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/**").hasRole("USER").and().formLogin();
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("user").password("password").roles("USER");
}
}
반응형
Comments