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.
OAuth
Apple 로그인 구현
Fittering 서비스에서 apple 로그인 기능을 이용할 수 있도록 구현했습니다.
apple은 기존에 구현한 google, kakao OAuth에서 사용하는 방식이나 응답 폼이 달라서 추가로 서비스 로직 및 클래스를 정의했습니다.
테스트까지 완료했습니다.
CORS 필터 설정
기존 CORS 설정으로는 소셜 로그인을 할 때 CORS 정책을 통과하지 못하는 문제가 있었습니다.
CORS 필터
CorsFilter
를 가장 높은 우선순위로 설정 후 정의해주면서 해결할 수 있었습니다.OAuth에 JWT 적용
기존 google, kakao 소셜 로그인은 세션으로 동작했지만 지금은 인증/인가를 JWT로 처리하도록 변경했기 때문에
각 개발 공식 문서를 참고해 API 함수 내부적으로
RestTemplate
을 활용해 한 번 더 호출하면서id_token
를 응답으로 받아사용자가 입력한
email
을 추출해 직접 JWT를 생성하고 쿼리 스트링과 함께/login
으로 redirect 하도록 설정했습니다.google, kakao, apple 서버에서 발급해주는 JWT를 사용하지 않고, 서버에서 직접 생성한 JWT를 사용합니다.
테스트까지 완료했습니다.
References