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
- spring
- DBMS
- Linux
- 자바
- 책추천
- SQL
- git
- 후기
- 명령어
- 오블완
- PostgreSQL
- Javascript
- 개발
- 독서
- AI
- java
- Python
- 티스토리챌린지
- IntelliJ
- docker
- 네트워크
- react
- mssql
- mysql
- 리눅스
- pandas
- oracle
- MariaDB
- 책
- 개발자
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/**");
}
이렇게 설정을 완료하고 재실행하면 잘들어가진다.
반응형