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 | 31 |
Tags
- 넥사크로
- Python
- 인터페이스
- 명령어
- PostgreSQL
- 책
- spring
- java
- 인덱스
- pandas
- github
- 티스토리챌린지
- springboot
- 네트워크
- mssql
- mysql
- Javascript
- DBMS
- git
- 오블완
- Linux
- 리눅스
- 후기
- 자바
- SQL
- docker
- IntelliJ
- 독서
- 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/**");
}
이렇게 설정을 완료하고 재실행하면 잘들어가진다.
반응형