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
- 오블완
- 네트워크
- 리눅스
- 명령어
- 후기
- IntelliJ
- SQL
- spring
- react
- 독서
- mssql
- 개발
- Linux
- 책추천
- docker
- 자바
- AI
- oracle
- pandas
- java
- git
- Javascript
- PostgreSQL
- DBMS
- 웹
- 책
- MariaDB
- Python
- mysql
- 티스토리챌린지
Archives
- Today
- Total
hanker
Spring h2-console 접속 안될때 (403 Error) 본문
반응형
h2-console을 사용하여 개발을 진행하던 중 Spring security를 적용하니 갑자기 h2-console이 적용이 안된다.
음..?
spring security를 적용하면서 h2-console/** 까지 막아버려서(?) 그렇다
설정파일에 h2-console을 허용 시켜보자
각자가 설정한 SecurityConfig 클래스를 보면
@Override
protected void configure(HttpSecurity http) throws Exception{
http
.authorizeRequests()
.antMatchers("/","/**").access("permitAll")
.antMatchers("/h2-console/**").permitAll() // 추가
.and()
.csrf() // 추가
.ignoringAntMatchers("/h2-console/**").disable() // 추가
.httpBasic();
}
// Security 무시하기
public void configure(WebSecurity web)throws Exception{
web.ignoring().antMatchers("/h2-console/**");
}
이렇게 설정을 완료하고 재실행하면 잘들어가진다.
반응형