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 |
Tags
- rsync
- mysql
- 자바
- MongoDB
- JPA
- Javascript
- docker
- java
- 오블완
- group by
- analytics4
- 티스토리챌린지
- PostgreSQL
- 차이점
- SQL
- 추상클래스
- 리눅스
- 트랜잭션
- top
- MariaDB
- DBMS
- oracle
- 호이스팅
- git
- 명령어
- 인터페이스
- mssql
- spring
- IntelliJ
- Linux
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/**");
}
이렇게 설정을 완료하고 재실행하면 잘들어가진다.
반응형