-
Notifications
You must be signed in to change notification settings - Fork 3
인증서버 webflux로 전환 #354
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
Open
bo-ram-bo-ram
wants to merge
32
commits into
dev
Choose a base branch
from
be-feat/auth-webflux
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
인증서버 webflux로 전환 #354
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…thenticationManager, JwtServerAuthenticationConverter
✅ Deploy Preview for jootalkpia canceled.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request
Related issue
Motivation and context
spring cloud gateway는 webflux기반 비동기 방식으로 구현되어있지만 인증서버는 mvc로 구현되어 블로킹이 발생하고 있었습니다. 이를 해결하기 위해 인증 서버를 WebFlux 환경으로 변경했습니다.
기존 Spring MVC 기반의 인증 서버에서 WebFlux 환경으로 전환하면서 발생하는 다양한 문제들을 해결했습니다.
기존에 사용하던
@Transactional,JpaRepository,WebMvcConfigurer등 MVC 전용 기능들이 WebFlux에서 지원되지 않아 동작하지 않음Redis에 reactive repository를 사용하려 했지만, Spring Data Redis는 reactive를 지원하지 않음 →
CrudRepository로 유지Kakao 로그인시 FeignClient를 사용하는 방식이 blocking이라 WebClient로 전환인증 관련 에러 응답을 Mono 흐름 안에서 처리할 수 있도록 커스텀 핸들러 구현 필요
Solution
WebFlux 기반으로 인증 서버 전반을 리팩토링했습니다:
1. WebClient 기반 Kakao 소셜 로그인 구현
WebClient로 전환KakaoAuthWebClientService및KakaoApiClient생성KakaoSocialService에서 Mono 체인으로 처리2. 전반적인 reactive 환경 전환
Mono<T>적용UserRepository를ReactiveCrudRepository로 교체3. JWT 인증 필터 및 예외 처리
JwtAuthenticationFilter를 WebFilter로 재작성ReactiveAuthenticationManager,ServerAuthenticationConverter구현CustomAccessDeniedHandler,CustomJwtAuthenticationEntryPoint수정GlobalExceptionHandler를 WebFlux에 맞게 Mono 기반으로 전환4. 기타 변경 사항
application.yml환경설정 WebFlux에 맞게 정리5. 추가 트러블슈팅
How has this been tested
/swagger-ui.html)Types of changes
Checklist