Skip to content

[#763] Google 인증을 GoogleSignIn serverAuthCode 흐름으로 전환한다 - #771

Merged
opficdev merged 12 commits into
developfrom
refactor/#763
Jul 27, 2026
Merged

[#763] Google 인증을 GoogleSignIn serverAuthCode 흐름으로 전환한다#771
opficdev merged 12 commits into
developfrom
refactor/#763

Conversation

@opficdev

Copy link
Copy Markdown
Owner

🔗 연관된 이슈

🎯 의도

  • Google 인증 화면에 Hosting 주소가 노출되는 callback/session/ticket 방식 제거
  • GoogleSignIn에서 발급한 일회성 serverAuthCode만 전달하는 인증 구조로 전환
  • Staging과 Release의 Google OAuth 설정 불일치를 배포 전에 확인할 수 있도록 검증 보강

📝 작업 내용

📌 요약

  • GoogleSignIn 패키지와 앱 URL 콜백 처리 추가
  • Google 로그인과 계정 연결을 serverAuthCode 기반 API로 전환
  • Google 로그아웃 시 로컬 GoogleSignIn 세션 정리 추가
  • 앱의 기존 Google ticket/session endpoint 호출 계약 제거
  • 환경별 Google OAuth 설정과 IPA 설정값 검증 추가
  • Google 인증 오류와 endpoint 관련 테스트 추가

🔍 상세

GoogleSignIn 연동

  • GoogleSignIn 패키지 의존성과 Infra 모듈 연결 추가
  • AppDelegate.application(_:open:options:)에서 GoogleSignIn URL 콜백 처리
  • TopViewControllerProvider를 통한 GoogleSignIn 표시 화면 탐색
  • GoogleSignIn 취소 오류를 기존 소셜 로그인 취소 오류로 변환
  • 일반 로그아웃 시 GIDSignIn.sharedInstance.signOut() 호출 추가

로그인 및 계정 연결

  • 로그인 시 serverAuthCodePOST /auth/google/authorization-code/custom-token으로 전달
  • 반환된 custom token을 이용한 로그인 처리
  • 계정 연결 시 ID token과 serverAuthCodePUT /auth/google/authorization-code/account-link로 전달
  • 계정 연결 완료 후 사용자 정보 갱신
  • 앱에서 Google ID token, access token, refresh token을 전달하거나 저장하지 않는 구조 적용

기존 인증 흐름 정리

  • OAuthAuthenticationTicketRequester를 사용하던 Google 전용 ticket/session 호출 제거
  • Google 계정 연결 해제와 회원 탈퇴 흐름 유지
  • GitHub callback/session/ticket 인증 흐름 유지

환경 설정 및 배포 검증

  • Info.plistGIDClientID, GIDServerClientID, reversed client ID URL scheme 연결
  • Staging과 Release별 CLIENT_ID, GID_SERVER_CLIENT_ID, REVERSED_CLIENT_ID 확인 추가
  • IPA의 GIDClientID와 bundled GoogleService-Info.plistCLIENT_ID 일치 여부 확인
  • reversed client ID URL scheme 포함 여부 확인
  • 설정값 불일치 오류에서 실제 OAuth 값 가림 처리

📸 영상 / 이미지 (Optional)

  • 없음

@opficdev opficdev self-assigned this Jul 26, 2026
@opficdev

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78a1ff9335

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Application/App/Sources/App/Delegate/AppDelegate.swift
Comment thread Application/Infra/Sources/Common/TopViewControllerProvider.swift Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

try await FunctionAPIClient.shared.send(.revokeGoogleAccessToken)

P2 Badge 회원 탈퇴에서도 Google 로컬 세션을 정리하세요

Google로 로그인하거나 계정을 연결한 사용자가 회원 탈퇴에 성공하면 이 경로는 서버의 access token만 폐기하고, 이후 AuthenticationRepositoryImpl.delete()도 Firebase 세션만 정리하므로 GIDSignIn의 로컬 세션이 남습니다. 기존 로그아웃 지적과 달리 현재 signOut()은 모든 provider를 순회하지만 회원 탈퇴 경로에서는 여전히 GIDSignIn.sharedInstance.signOut()이 호출되지 않는다는 점이 새 근거이며, 탈퇴 후 다시 Google 인증을 시작하면 삭제한 계정의 SDK 상태에서 시작될 수 있으므로 성공한 탈퇴 경로에서도 이를 정리해야 합니다.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@opficdev opficdev changed the title Refactor/#763 [#763] Google 인증을 GoogleSignIn serverAuthCode 흐름으로 전환한다 Jul 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 458e807e7e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@opficdev
opficdev merged commit 2579a92 into develop Jul 27, 2026
8 checks passed
@opficdev
opficdev deleted the refactor/#763 branch July 27, 2026 14:09
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.

Google 인증을 GoogleSignIn serverAuthCode 흐름으로 전환한다

1 participant