Skip to content

Implement Kakao OAuth login using OIDC ID token#6

Merged
subsub97 merged 11 commits intomainfrom
kakao-login
Feb 3, 2026
Merged

Implement Kakao OAuth login using OIDC ID token#6
subsub97 merged 11 commits intomainfrom
kakao-login

Conversation

@subsub97
Copy link
Collaborator

@subsub97 subsub97 commented Feb 2, 2026

This pull request introduces a comprehensive authentication and authorization system based on JWT and OIDC, along with improvements to controller endpoints to enforce user identity. It also includes infrastructure changes for submodule management and deployment configuration. The most important changes are grouped below.

Authentication & Authorization Infrastructure

  • Added JWT authentication filter (JwtAuthenticationFilter), token provider (JwtTokenProvider), and argument resolver (AuthenticatedMemberResolver) to enable secure user identification and request filtering. This allows controllers to access the authenticated member's ID and restrict access based on authentication. [1] [2] [3] [4] [5] [6]
  • Implemented OIDC integration for Kakao login: includes OIDC client for public key retrieval, token validation, caching, configuration, and user info extraction. This enables secure third-party authentication and supports future provider expansion. [1] [2] [3] [4] [5]

Controller & Endpoint Changes

  • Updated OnboardingController endpoints to require authenticated member information via the new resolver, ensuring all onboarding actions are tied to a verified user. [1] [2] [3]
  • Added AuthController with a Kakao sign-in/up endpoint, delegating authentication logic to the new service layer.

Domain Model

  • Introduced the Member entity to represent authenticated users, including provider details and profile linkage for future extensibility.

Configuration & Deployment

  • Enabled recursive submodule checkout and secure token usage in deployment workflow, and added the moa-secret submodule for secret management. [1] [2]
  • Updated Docker deployment to use the prod profile for production readiness.
  • Enabled configuration property scanning for OIDC and JWT settings.

Error Handling

  • Added new error codes for authentication and OIDC-related failures, improving clarity and maintainability of error responses.

Let me know if you want to dive deeper into any specific part of the authentication flow or how to use these new controller patterns!

@subsub97 subsub97 requested a review from jeyongsong February 2, 2026 15:40
@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Test Results

8 tests   8 ✅  0s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit dd43b08.

♻️ This comment has been updated with latest results.

Copy link
Member

@jeyongsong jeyongsong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모야 코드 넘 좋은디?? ㅋㅋㅋㅋㅋ

다음에 애플 연동하면서

image

common 내부 폴더 많이 안나오게만 해줘~~
초반에는 최대한 크게 크게 묶는게 나중에 리팩하기 편하다고 생각해스

Comment on lines 25 to 26
submodules: recursive
token: ${{ secrets.BE_SUBMODULE_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 이거 앞에 prefix BE 빼도 되는딩 지금 레포는 우리 밖에 안쓰고 있어서!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인정하는 부분임다

Comment on lines 23 to 25
jwks-uri: ${ouath.kakao.jwks-uri}
issuer: ${ouath.kakao.issuer}
audience: ${ouath.kakao.audience}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ouath -> oauth 오타!! ㅋㅋㅋ

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그저 빛

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 그리고 이거 꿀팁이
시크릿 폴더안에 있는 변수들은 앞에 prefix로 secret 붙여야 덜 헷갈리더라~~

나중에 이게 변수인지 설정인지 헷갈리더라고

Copy link
Collaborator Author

@subsub97 subsub97 Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오게이~~

// 프로필 완료 여부 (임시 stub)
val profile = profileRepository.findAll().firstOrNull()
// 프로필 완료 여부
val profile = profileRepository.findByMemberId(memberId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

parameter.parameterType == AuthenticatedMemberInfo::class.java
}

override fun resolveArgument(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow 재밋다잉~

return
}

request.setAttribute(AuthConstants.CURRENT_MEMBER_ID, memberId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오오오 이렇게 했구나~~ 구우웃!

response.contentType = MediaType.APPLICATION_JSON_VALUE
response.characterEncoding = "UTF-8"

val errorCode = ErrorCode.UNAUTHORIZED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분 jackson 쓰면 깔끔해질텐데~! 🙋

.retrieve()
.body(JwksResponse::class.java)
} catch (ex: Exception) {
throw UnauthorizedException(ErrorCode.OIDC_PROVIDER_ERROR)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4xx는 클라이언트쪽 문제라는 건데 이건 서버 쪽 문제지 않나??

그런 측면에서 500 쪽이 더 가까운듯?? 🙋 그냥 RuntimeException 던지고 GlobalExceptionHandler에서 내부 로그 찍고INTERNAL_SERVER_ERROR 로 보여주는거 어때?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

진짜 너무 좋아 300만번 고민함

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

관련해서 https://techblog.woowahan.com/21686/ 도 추천!!

Comment on lines 11 to 12
val issuer: String,
val audience: String,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 OIDC id_token 검증할 때 사용 안해도 되남?? 🙋

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

엇 사용안하려고 검증로직에선 뺏는데 여기를 누락했슴요
삭제할게여~

@subsub97 subsub97 merged commit a7564a1 into main Feb 3, 2026
2 checks passed
@subsub97 subsub97 deleted the kakao-login branch February 3, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants