콘텐츠로 이동

Apple

Apple 로그인(Sign in with Apple)을 사용하면 사용자가 Apple ID로 tinyauth에 로그인할 수 있어요. 이 가이드는 Apple Developer에서 서비스를 등록하고 tinyauth에 연동하는 방법을 설명해요.


  1. Apple Developer에 접속하여 로그인해요.
  2. Certificates, Identifiers & Profiles로 이동해요.
  3. Identifiers에서 새로운 App ID를 등록해요. Sign in with Apple 기능을 활성화해요.
  4. Identifiers에서 새로운 Services ID를 등록해요:
    • 이 Services ID의 Identifierclient_id가 돼요.
    • Sign in with Apple을 활성화하고 Configure를 클릭해요.
    • Domains and Subdomains에 도메인을 추가해요 (예: auth.example.com).
    • Return URLs에 콜백 URL을 추가해요:
      https://내_도메인.com/api/oauth/apple/callback
  5. Keys에서 새로운 키를 만들고 Sign in with Apple을 활성화해요. 다운로드한 .p8 파일과 Key ID를 안전하게 보관해요.

Apple Developer에서 준비한 자격증명을 config.yaml에 설정해요.

config.yaml
identity_providers:
- id: apple
type: apple
enabled: true
client_id: com.example.auth
client_secret: ${APPLE_CLIENT_SECRET}
  • id: 이 제공자의 고유 식별자예요. 콜백 URL에 사용돼요.
  • type: apple로 지정해요.
  • client_id: Apple Developer에서 등록한 Services ID의 Identifier예요.
  • client_secret: 생성한 JWT client secret이에요.

tinyauthhttps://auth.example.com에서 운영하는 경우의 전체 설정 예시예요.

config.yaml
server:
public_origin: https://auth.example.com
identity_providers:
- id: apple
type: apple
enabled: true
client_id: com.example.auth
client_secret: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...

이 경우 Apple Developer의 Return URL은 다음과 같이 설정해야 해요.

https://auth.example.com/api/oauth/apple/callback