내용으로 건너뛰기

안드로이드에서 Supabase Google 로그인

GitHub

소개

소개

이 안내서에서는 Android에서 Google Sign-In을 Supabase Authentication과 통합하는 방법을 설명합니다. 이미 완료한 것으로 가정합니다:

구현은 예제 앱의

complete implementation

complete implementation complete implementation supabaseAuthUtils.ts 파일. 이 안내서에서는 주요 개념과 사용 방법을 설명합니다.

The authenticateWithGoogleSupabase 함수는 인증 흐름의 모든 단계를 처리합니다.

import { authenticateWithGoogleSupabase } from './supabaseAuthUtils';
const result = await authenticateWithGoogleSupabase();
if (result.success) {
console.log('Signed in:', result.user);
// Navigate to your authenticated area
} else {
console.error('Error:', result.error);
}

인증 흐름의 세부 설명을 원한다면, nonce 생성, JWT 검증, Supabase 로그인에 대한 정보는 일반 설정 안내서의 "작동 방식" 섹션을 참조하세요. 완전한 __CAPGO_KEEP_0__ 참조를 원한다면, 일반 설정 안내서의 "__CAPGO_KEEP_0__ 참조" 섹션을 참조하세요..

For the complete code reference, see the Complete Code Reference section in the General Setup guide.

중요한 참고 사항

중요한 참고 사항 섹션

Nonce 구현은 React Native Google Sign In 문서에서 설명하는 패턴을 따릅니다. Supabase로 이동:

  • rawNonce Supabase는 signInWithIdToken()
  • 해시를 생성 rawNonce 해시와 nonceDigest Google Sign-In에서 제공하는 ID 토큰의
  • nonceDigest (SHA-256 해시, 16진수 인코딩)으로 이동 nonce Google Sign-In API의

__CAPGO_KEEP_0__

__CAPGO_KEEP_1__

__CAPGO_KEEP_2__

  • __CAPGO_KEEP_3__
  • __CAPGO_KEEP_4__
  • __CAPGO_KEEP_5__

__CAPGO_KEEP_6__

__CAPGO_KEEP_7__

__CAPGO_KEEP_8__

  • __CAPGO_KEEP_9____CAPGO_KEEP_10__
  • __CAPGO_KEEP_11__: 콘솔 로그를 확인하세요 - 함수는 자동으로 다시 시도하지만 필요 시 로그아웃을 수동으로 먼저 해보세요
  • 토큰 유효성 검사 실패: __CAPGO_KEEP_0__ 예제 앱을 참조하여 mode: 'online' initialize 호출에서 idToken을 얻기 위해
  • 사용 중인 경우 example app code Supabase Google Login on Android를 사용하여 인증 및 계정 흐름을 계획하고 연결하세요

Keep going from Supabase Google Login on Android If you are using to plan authentication and account flows, connect it with Using @capgo/capacitor-social-login for the native capability in Using @capgo/capacitor-social-login @capgo/capacitor-social-login for the implementation detail in @capgo/capacitor-social-login @capgo/capacitor-passkey for the implementation detail in @capgo/capacitor-passkey @capgo/capacitor-native-biometric for the implementation detail in @capgo/capacitor-native-biometric, and Two-factor authentication for the implementation detail in Two-factor authentication.