-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix #33] 시류리티 config 변경 및 API 인증 예외 처리 #35
Conversation
- cors 커스텀 적요을 위한 cors 허용 - 인가 필요한 API permitAll() 제거
Test Results43 tests 37 ✅ 5s ⏱️ Results for commit 9e85368. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다🙂
src/main/java/com/dnd/gongmuin/security/exception/SecurityErrorCode.java
Outdated
Show resolved
Hide resolved
@@ -35,7 +36,7 @@ public WebSecurityCustomizer webSecurityCustomizer() { | |||
@Bean | |||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { | |||
http | |||
.cors((auth) -> auth.disable()) | |||
.cors(Customizer.withDefaults()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위 코드는 어떤건지 설명해주실 수 있을까요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cors 비허용했다가 이를 기본값으로 설정해주도록 변경했는데, 제가 커스텀한 cors가 제대로 작동이 안될때가 있는것 같습니다.
수정 하겠습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WebConfig를 통해 cors 정책을 커스텀 했는데, 이건 Spring MVC에서만 사용되고, Secuirty에서는 적용되지 않을수도 있었네요
그래서 custom corsConfigurationSource Bean을 등록해서 Security에서도 커스텀 cors 정책이 적용되도록 수정했습니다!
관련 이슈
📑 작업 상세 내용
💫 작업 요약
🔍 중점적으로 리뷰 할 부분