Skip to content

[#718] GitHub 인증을 서버 callback과 공통 OAuth 모델 기반으로 전환한다#721

Merged
opficdev merged 4 commits into
developfrom
refactor/#718
Jul 12, 2026
Merged

[#718] GitHub 인증을 서버 callback과 공통 OAuth 모델 기반으로 전환한다#721
opficdev merged 4 commits into
developfrom
refactor/#718

Conversation

@opficdev

Copy link
Copy Markdown
Owner

🔗 연관된 이슈

🎯 의도

  • GitHub 인증 과정에서 iOS가 담당하던 authorization code 처리, GitHub API 호출, access token 저장과 Firebase provider 연결 책임을 서버 callback 방식으로 이전
  • GitHub·Apple·Google 인증 전환에서 재사용할 수 있는 OAuth session과 Firebase custom token 공통 계약 구성

📝 작업 내용

📌 요약

  • GitHub 인증을 서버 callback과 일회용 ticket 교환 방식으로 전환
  • 공급자 공통 OAuth 요청·응답 모델 추가
  • OAuthWebAuthenticationProofOAuthWebAuthenticationSession 추가
  • GitHub access token의 클라이언트 전달·저장 제거
  • iOS GitHub OAuth 설정 제거
  • Apple 인증 응답 모델을 공급자 공통 타입으로 전환

🔍 상세

  • 서버에서 GitHub authorizationURL을 요청하는 흐름으로 변경
  • ASWebAuthenticationSession에서 서버가 반환한 URL을 표시하도록 변경
  • DevLog://oauth-callback에서 일회용 ticket만 추출하도록 변경
  • app verifier와 SHA-256 app challenge 생성 및 callback 검증 추가
  • ticket과 app verifier를 서버에 전달해 Firebase custom token을 발급받는 흐름 추가
  • Firebase custom token을 signIn(withCustomToken:)에 사용하는 로그인 흐름 구성
  • 로그인 취소 시 nil, 계정 연결 취소 시 false를 반환하는 기존 동작 유지
  • 계정 연결·해제 이후 Firebase 사용자 정보를 갱신하는 동작 유지
  • GitHub /user, /user/emails 직접 호출 제거
  • GitHub authorization code와 access token의 iOS 처리 제거
  • Firebase provider 직접 연결·해제 로직 제거
  • Firestore githubAccessToken 저장·삭제 로직 제거
  • AuthDataResponse.accessToken 제거
  • APP_REDIRECT_URL, GITHUB_CLIENT_ID 제거
  • DevLog URL scheme 유지
  • AppleCustomTokenResponseFirebaseCustomTokenResponse로 변경
  • AppleOperationResponseEmptyAPIResponse로 대체
  • OAuth 요청 encoding, endpoint 경로, app challenge와 ticket 검증 테스트 추가

📸 영상 / 이미지 (Optional)

  • 해당 없음

@opficdev opficdev self-assigned this Jul 12, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

이 풀 리퀘스트는 GitHub 및 Apple 소셜 로그인 흐름을 리팩토링하여 클라이언트 측의 복잡한 OAuth 인증 로직을 Firebase Functions 및 신규 공통 세션 처리 클래스(OAuthWebAuthenticationProof, OAuthWebAuthenticationSession)로 이관하고, 불필요한 액세스 토큰 저장 로직을 제거합니다. 리뷰 피드백으로는 OAuthWebAuthenticationProof에서 콜백 URL의 호스트를 비교할 때 RFC 3986 표준에 따라 대소문자 구분 없이 안전하게 비교하도록 caseInsensitiveCompare를 사용할 것을 제안했습니다.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread Application/Infra/Sources/Service/SocialLogin/OAuthWebAuthenticationProof.swift Outdated
@opficdev opficdev merged commit fc3b615 into develop Jul 12, 2026
7 checks passed
@opficdev opficdev deleted the refactor/#718 branch July 12, 2026 06:24
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.

GitHub 인증을 서버 callback과 공통 OAuth 모델 기반으로 전환한다

1 participant