컨텐츠로 바로가기

Firbase 인증

GitHub

설치

설치

AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 기능을 추가하려면 다음 명령어를 사용하세요:

터미널 창
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

다음 명령어를 사용하세요:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-firebase-authentication` plugin in my project.

Manual Setup을 사용하는 경우, 플러그인을 설치하려면 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:

터미널 창
bun add @capgo/capacitor-firebase-authentication
bunx cap sync

Import

Import
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';

code 인증 코드를 적용합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.applyActionCode({} as ApplyActionCodeOptions);

confirmPasswordReset

제목: confirmPasswordReset

비밀번호 초기화 프로세스를 완료합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.confirmPasswordReset({} as ConfirmPasswordResetOptions);

confirmVerificationCode

제목: confirmVerificationCode

휴대폰 인증 코드를 확인합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.confirmVerificationCode({} as ConfirmVerificationCodeOptions);

createUserWithEmailAndPassword

제목: createUserWithEmailAndPassword

이메일과 비밀번호를 사용하여 새로운 사용자 계정을 생성합니다. 새로운 계정이 생성되면 사용자는 자동으로 로그인됩니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.createUserWithEmailAndPassword({} as CreateUserWithEmailAndPasswordOptions);

deleteUser

삭제하기

__CAPGO_KEEP_0__

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.deleteUser();

fetchSignInMethodsForEmail

__CAPGO_KEEP_0__

현재 로그인한 사용자를 가져옵니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.fetchSignInMethodsForEmail({} as FetchSignInMethodsForEmailOptions);

__CAPGO_KEEP_0__

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.getCurrentUser();

getPendingAuthResult

__CAPGO_KEEP_0__

__CAPGO_KEEP_0__ SignInResult __CAPGO_KEEP_0__ 앱이 웹 로그인 흐름을 시작했으며 OS가 앱을 백그라운드에서 삭제하는 경우 반환합니다.

__CAPGO_KEEP_0__은 Android에서만 사용할 수 있습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.getPendingAuthResult();

현재 로그인한 사용자의 Firebase Auth ID 토큰을 가져옵니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.getIdToken();

getIdTokenResult

getIdTokenResult 제목

JSON Web Token (JWT)을 사용하여 사용자를 식별하는 데 사용되는 Firebase 서비스에 대한 사용자 식별 정보를 반환합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.getIdTokenResult();

getRedirectResult

getRedirectResult 제목

__CAPGO_KEEP_0__ SignInResult redirect-based 로그인 흐름에서부터.

로그인에 실패한 경우 오류와 함께 실패합니다. redirect 연산이 호출되지 않은 경우 null 사용자와 함께 반환합니다. SignInResult redirect 연산이 호출되지 않은 경우 null 사용자와 함께 반환합니다.

웹 전용.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.getRedirectResult();

getTenantId

getTenantId

테넌트 아이디를 가져옵니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.getTenantId();
isSignInWithEmailLink

이메일 링크로 로그인하는 incoming 링크가 적합한지 확인합니다. signInWithEmailLink.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.isSignInWithEmailLink({} as IsSignInWithEmailLinkOptions);

linkWithApple

linkWithApple

Apple 인증 제공자와 사용자 계정을 연결합니다.

네이티브层에서 사용자가 로그인되어야 합니다. skipNativeAuth 이 설정 옵션은 이곳에서 영향을 미치지 않습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithApple();

이메일 인증 제공자와 사용자 계정을 연결합니다.

네이티브层에서 사용자가 로그인되어야 합니다. skipNativeAuth 이 설정 옵션은 이곳에서 영향을 미치지 않습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithEmailAndPassword({} as LinkWithEmailAndPasswordOptions);

이메일 인증 제공자와 사용자 계정을 연결합니다.

네이티브层에서 사용자가 로그인되어야 합니다. skipNativeAuth 설정 옵션은 이곳에서 영향을 미치지 않습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithEmailLink({} as LinkWithEmailLinkOptions);

Facebook 인증 제공자와 사용자 계정을 연결합니다.

native layer에서 로그인한 사용자만 사용할 수 있습니다. skipNativeAuth 설정 옵션은 이곳에서 영향을 미치지 않습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithFacebook();

Game Center 인증 제공자와 사용자 계정을 연결합니다.

native layer에서 로그인한 사용자만 사용할 수 있습니다. skipNativeAuth 설정 옵션은 이곳에서 영향을 미치지 않습니다.

iOS에서만 사용할 수 있습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithGameCenter();

Links the user account with GitHub authentication provider.

사용자는 네이티브层에서 로그인되어야 합니다. skipNativeAuth 이 설정 옵션은 이곳에서 효과가 없습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithGithub();

Google 인증 제공자를 사용자 계정과 연결합니다.

사용자는 네이티브层에서 로그인되어야 합니다. skipNativeAuth 이 설정 옵션은 이곳에서 효과가 없습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithGoogle();

linkWithMicrosoft

Microsoft과 연결하기

사용자 계정에 Microsoft 인증 제공자를 연결합니다.

사용자는 네이티브层에서 로그인되어야 합니다. skipNativeAuth 이 구성 옵션은 여기에 영향을 미치지 않습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithMicrosoft();

linkWithOpenIdConnect

링크WithOpenIdConnect

클립보드에 복사

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithOpenIdConnect({} as LinkWithOpenIdConnectOptions);

사용자는 네이티브层에서 로그인되어야 합니다.

이 구성 옵션은 여기에 영향을 미치지 않습니다. skipNativeAuth 사용

Use the phoneVerificationCompleted 인증이 완료되면通知받을 리스너입니다. 인증을 위해 사용하는 phoneVerificationFailed 인증이 실패하면通知받을 리스너입니다. 인증을 위해 사용하는 phoneCodeSent 인증 ID를 얻기 위한 리스너입니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithPhoneNumber({} as LinkWithPhoneNumberOptions);

Play Games 인증 제공자와 사용자 계정을 연결합니다.

사용자는 네이티브层에서 로그인되어 있어야 합니다. skipNativeAuth 이 옵션은 이곳에서 효과가 없습니다.

Android에서만 사용할 수 있습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithPlayGames();

Twitter 인증 제공자와 사용자 계정을 연결합니다.

사용자는 네이티브层에서 로그인되어야 합니다. skipNativeAuth 이 설정 옵션은 여기에 영향을 미치지 않습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithTwitter();

Yahoo 인증 제공자와 사용자 계정을 연결합니다.

사용자는 네이티브层에서 로그인되어야 합니다. skipNativeAuth 이 설정 옵션은 여기에 영향을 미치지 않습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithYahoo();

로그인한 사용자 계정 데이터를 재로드합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.reload();

해당 액세스 토큰을 취소합니다. 현재는 Apple OAuth 액세스 토큰만 지원합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.revokeAccessToken({} as RevokeAccessTokenOptions);

현재 로그인한 사용자에게 이메일 인증 메일을 보냅니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.sendEmailVerification();

사용자에게 비밀번호 재설정 메일을 보냅니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.sendPasswordResetEmail({} as SendPasswordResetEmailOptions);

사용자에게 이메일 주소와 이메일 링크를 보내고, 이메일을 통해 로그인할 수 있도록 합니다.

이메일 링크를 사용하여 로그인하기 위해 signInWithEmailLink 사용자 이메일 주소와 이메일 링크를 제공합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.sendSignInLinkToEmail({} as SendSignInLinkToEmailOptions);

setLanguageCode

setLanguageCode

인증 연산에 사용되는 사용자 대면 언어를 code로 설정합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.setLanguageCode({} as SetLanguageCodeOptions);

setPersistence

setPersistence

현재 저장된 인증 세션에 대한 저장 유형을 설정합니다.

웹 전용

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.setPersistence({} as SetPersistenceOptions);

setTenantId

setTenantId

테넌트 ID를 설정합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.setTenantId({} as SetTenantIdOptions);

signInAnonymously

signInAnonymously

비회원으로 로그인합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInAnonymously();

signInWithApple

signInWithApple

애플 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithApple();

signInWithCustomToken

signInWithCustomToken

커스텀 토큰 로그인 흐름을 시작합니다.

Android와 iOS에서 이 메소드는 함께 사용할 수 없습니다. 이 경우 Firebase JS __CAPGO_KEEP_0__의 인터페이스를 직접 사용해야 합니다. skipNativeAuth 클립보드에 복사 signInWithCustomToken interface of the Firebase JS SDK directly.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithCustomToken({} as SignInWithCustomTokenOptions);

signInWithEmailAndPassword

signInWithEmailAndPassword

이메일과 비밀번호를 사용하여 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithEmailAndPassword({} as SignInWithEmailAndPasswordOptions);
signInWithEmailLink

이메일과 로그인 이메일 링크를 사용하여 로그인합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithEmailLink({} as SignInWithEmailLinkOptions);

signInWithFacebook

signInWithFacebook

페이스북 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithFacebook();

signInWithGameCenter

signInWithGameCenter

게임 센터 로그인 흐름을 시작합니다.

iOS에서만 사용 가능합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithGameCenter();

signInWithGithub

GitHub 로그인

GitHub 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithGithub();

signInWithGoogle

Google 로그인

Google 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithGoogle();

signInWithMicrosoft

Microsoft 로그인

Microsoft 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithMicrosoft();

signInWithOpenIdConnect

OpenID Connect 로그인

OpenID Connect 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithOpenIdConnect({} as SignInWithOpenIdConnectOptions);

signInWithPhoneNumber

전화번호로 로그인

전화번호로 로그인 흐름을 시작합니다.

이벤트 리스너를 사용하여 인증이 완료되었을 때 알림을 받습니다. phoneVerificationCompleted 이벤트 리스너를 사용하여 인증이 실패되었을 때 알림을 받습니다. phoneVerificationFailed 이벤트 리스너를 사용하여 인증 ID를 가져옵니다. phoneCodeSent 안드로이드 및 iOS에서만 사용할 수 있습니다.

클립보드에 복사

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithPhoneNumber({} as SignInWithPhoneNumberOptions);

클립보드에 복사

__CAPGO_KEEP_0__

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithPlayGames();

signInWithTwitter

Twitter 로그인 시작

Twitter 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithTwitter();

signInWithYahoo

Yahoo 로그인 시작

Yahoo 로그인 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithYahoo();

로그아웃 흐름을 시작합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signOut();

서비스 제공자와 사용자 계정의 연결을 제거합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.unlink({} as UnlinkOptions);

현재 로그인한 사용자의 이메일 주소를 업데이트합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.updateEmail({} as UpdateEmailOptions);

현재 로그인한 사용자의 비밀번호를 업데이트합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.updatePassword({} as UpdatePasswordOptions);

사용자의 프로필 데이터를 업데이트합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.updateProfile({} as UpdateProfileOptions);

사용자에게 보이는 언어 code를 기본 앱 언어로 설정합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.useAppLanguage();

useEmulator

useEmulator

Firebase 인증 에뮬레이터와 통신하기 위해 앱을 구성하십시오.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.useEmulator({} as UseEmulatorOptions);

verifyBeforeUpdateEmail

verifyBeforeUpdateEmail

현재 로그인한 사용자의 이메일 주소를 업데이트하기 전에 새로운 이메일 주소를 확인합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.verifyBeforeUpdateEmail({} as VerifyBeforeUpdateEmailOptions);

checkAppTrackingTransparencyPermission

checkAppTrackingTransparencyPermission

앱 트래킹 투명도 상태를 확인합니다.

iOS에서만 사용할 수 있습니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.checkAppTrackingTransparencyPermission();

requestAppTrackingTransparencyPermission

requestAppTrackingTransparencyPermission

앱 트래킹 투명도 허용을 시스템 대화로 열어줍니다.

주의: 사용자는 장치 설정에서 추적 요청을 비활성화 할 수 있습니다. 자세한 내용은 Apple의 문서를 참조하십시오..

iOS에서만 사용 가능합니다.

import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.requestAppTrackingTransparencyPermission();
export interface ApplyActionCodeOptions {
/**
* A verification code sent to the user.
*
* @since 0.2.2
*/
oobCode: string;
}
export interface ConfirmPasswordResetOptions {
/**
* A verification code sent to the user.
*
* @since 0.2.2
*/
oobCode: string;
/**
* The new password.
*
* @since 0.2.2
*/
newPassword: string;
}
export interface ConfirmVerificationCodeOptions {
/**
* The verification ID received from the `phoneCodeSent` listener.
*
* The `verificationCode` option must also be provided.
*
* @since 5.0.0
*/
verificationId: string;
/**
* The verification code either received from the `phoneCodeSent` listener or entered by the user.
*
* The `verificationId` option must also be provided.
*
* @since 5.0.0
*/
verificationCode: string;
}
export interface SignInResult {
/**
* The currently signed-in user, or null if there isn't any.
*
* @since 0.1.0
*/
user: User | null;
/**
* Credentials returned by an auth provider.
*
* @since 0.1.0
*/
credential: AuthCredential | null;
/**
* Additional user information from a federated identity provider.
*
* @since 0.5.1
*/
additionalUserInfo: AdditionalUserInfo | null;
}

CreateUserWithEmailAndPasswordOptions

“CreateUserWithEmailAndPasswordOptions” 섹션
export interface CreateUserWithEmailAndPasswordOptions {
/**
* @since 0.2.2
*/
email: string;
/**
* @since 0.2.2
*/
password: string;
}

FetchSignInMethodsForEmailOptions

“FetchSignInMethodsForEmailOptions” 섹션
export interface FetchSignInMethodsForEmailOptions {
/**
* The user's email address.
*
* @since 6.0.0
*/
email: string;
}

FetchSignInMethodsForEmailResult

“FetchSignInMethodsForEmailResult” 섹션
export interface FetchSignInMethodsForEmailResult {
/**
* The sign-in methods for the specified email address.
*
* This list is empty when [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection)
* is enabled, irrespective of the number of authentication methods available for the given email.
*
* @since 6.0.0
*/
signInMethods: string[];
}
export interface GetCurrentUserResult {
/**
* The currently signed-in user, or null if there isn't any.
*
* @since 0.1.0
*/
user: User | null;
}
export interface GetIdTokenOptions {
/**
* Force refresh regardless of token expiration.
*
* @since 0.1.0
*/
forceRefresh: boolean;
}

GetIdTokenResult

GetIdTokenResult
export interface GetIdTokenResult {
/**
* The Firebase Auth ID token JWT string.
*
* @since 0.1.0
*/
token: string;
}

GetIdTokenResultOptions

GetIdTokenResultOptions
export interface GetIdTokenResultOptions {
/**
* Force refresh regardless of token expiration.
*
* @since 7.4.0
*/
forceRefresh: boolean;
}

GetIdTokenResultResult

GetIdTokenResultResult
export interface GetIdTokenResultResult {
/**
* The authentication time in milliseconds since the epoch.
*
* This is the time the user authenticated (signed in) and not the time the token was refreshed.
*
* @since 7.4.0
*/
authTime: number;
/**
* The ID token expiration time in milliseconds since the epoch.
*
* @since 7.4.0
*/
expirationTime: number;
/**
* The ID token issuance time in milliseconds since the epoch.
*
* @since 7.4.0
*/
issuedAtTime: number;
/**
* The sign-in provider through which the ID token was obtained.
*
* @since 7.4.0
*/
signInProvider: string | null;
/**
* The type of second factor associated with this session, provided the user was multi-factor
* authenticated (eg. phone, etc).
*
* @since 7.4.0
*/
signInSecondFactor: string | null;
/**
* The entire payload claims of the ID token including the standard reserved claims as well as
* the custom claims.
*
* @since 7.4.0
*/
claims: Record<string, unknown>;
}

실질적 진실의 근원

실질적 진실의 근원

이 페이지는 플러그인의 src/definitions.ts공개 API이 업스트림에서 변경될 때 다시 싱크를 실행하세요.

Getting Started에서 계속하세요.

시작하기에서 계속하기

이러한 기능을 사용 중이라면 시작하기 인증 및 계정 흐름을 계획하고자 할 때 Capgo에서 @capgo/capacitor-social-login Capgo에서 @capgo/capacitor-social-login의 구현 세부 정보를 참조하세요. Capgo에서 @capgo/capacitor-passkey Capgo에서 @capgo/capacitor-passkey의 구현 세부 정보를 참조하세요. Capgo에서 @capgo/capacitor-native-biometric Capgo에서 @capgo/capacitor-native-biometric의 구현 세부 정보를 참조하세요. 두 단계 인증 두 단계 인증의 구현 세부 정보를 참조하세요. SSO (기업) SSO (기업) 구현 세부 사항에 대한 정보입니다.