Skip to content

[FEAT] 애플 소셜로그인 서버 연동 - #8

Merged
dlrjswns merged 8 commits into
developfrom
feature/auth
Jul 31, 2026
Merged

[FEAT] 애플 소셜로그인 서버 연동 #8
dlrjswns merged 8 commits into
developfrom
feature/auth

Conversation

@dlrjswns

Copy link
Copy Markdown
Contributor

Describe

Apple 소셜 로그인 및 Firebase Authentication 연동을 구현하고 서버 로그인 API 연동을 위한 네트워크 계층을 구성했습니다.

Works made

  • Apple Sign In 기능 구현
  • Firebase Authentication을 이용한 Apple 로그인 연동
  • Firebase ID Token 발급 및 서버 로그인 API 연동
  • AuthRepository 및 UseCase 구현
  • TokenStorage를 이용한 Access Token / Refresh Token 저장 로직 구현
  • Network Layer(Endpoint, NetworkManager) 구현
  • 공통 API Response 모델(APIResponse) 추가
  • JSON 요청을 위한 기본 Header(Content-Type, Accept) 적용
  • Authentication 관련 Error 정의 및 예외 처리

Changes Made

As-Is

기존 로직

  • 로그인 기능이 구현되어 있지 않았습니다.
  • Firebase Authentication 및 Apple Sign In 연동이 없는 상태였습니다.
  • 서버 로그인 API와 통신하는 네트워크 계층이 구성되어 있지 않았습니다.

스크린샷
없음

To-BE

변경 로직

  • Apple Sign In을 통해 사용자 인증을 수행합니다.
  • Firebase Authentication을 이용하여 Firebase ID Token을 발급받습니다.
  • 발급받은 Firebase ID Token을 서버 로그인 API로 전달합니다.
  • 서버에서 반환한 Access Token / Refresh Token을 안전하게 저장합니다.
  • 공통 Network Layer 및 APIResponse 모델을 이용하여 API를 처리하도록 변경했습니다.
  • JSON 요청을 위한 기본 Header를 공통으로 적용했습니다.

스크린샷
없음

How to Test

  1. Firebase Authentication에서 Apple 로그인 Provider가 활성화되어 있는지 확인합니다.
  2. 앱을 실행합니다.
  3. Apple 로그인을 진행합니다.
  4. 서버 로그인 API가 정상 호출되는지 확인합니다.
  5. Access Token 및 Refresh Token이 정상 저장되는지 확인합니다.

Issues Resolved

Additional context

  • baseURLString은 보안상의 이유로 Git에 포함하지 않아 현재 빈 값으로 설정되어 있습니다.
  • 프로젝트를 실행하기 전에 각자 개발 환경에 맞는 Base URL을 직접 설정해야 합니다.
  • 해당 설정은 추후 xcconfig 기반 환경 설정으로 전환하여 관리할 예정입니다.
  • 추후 첫 화면 진입점을 LoginState를 가지고 다루면 될꺼같습니다.

References

키체인 공식 문서 링크

@dlrjswns
dlrjswns requested a review from cchanmi July 29, 2026 14:08
@dlrjswns dlrjswns self-assigned this Jul 29, 2026
@dlrjswns dlrjswns added the enhancement New feature or request label Jul 29, 2026
dlrjswns added 4 commits July 30, 2026 09:53
- LoginState 현재 앱 로그인 여부 상태값
- KeyChainManager 키체인 관리 유틸
- TokenStorage 토큰값 저장소 유틸
- Auth관련 Endpoint
- Auth관련 Repository 및 DTO 모델
Comment thread GAMSS/Sources/Data/DTO/APIResponse.swift
Comment thread GAMSS/Sources/Data/Storage/TokenStorage.swift Outdated
Comment thread GAMSS/Sources/Data/Storage/TokenStorage.swift Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

모야랑 비슷하네요

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@cchanmi 지금 Endpoint에서 헤더값에 디폴트로 넣고있는데 추후에 토큰값을 넣어야하는 경우에 따른 HeaderType도 넣으면 깔끔할꺼같아요 👍

@cchanmi cchanmi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

고생하셨어요
로그인 정상 동작 확인했습니다~

Comment on lines +17 to +21
let query = [kSecAttrService: service,
kSecClass: account.keyChainClass,
kSecAttrAccount: account.description,
kSecValueData: data.data(using: .utf8, allowLossyConversion: false)!] as CFDictionary

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

실패시 crash 발생이라 guard let을 사용하는 것도 좋을 것 같습니다

@dlrjswns
dlrjswns merged commit 38c6f52 into develop Jul 31, 2026
1 check passed
@dlrjswns
dlrjswns deleted the feature/auth branch July 31, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants