快速入门
复制包含安装步骤和该插件完整 Markdown 指南的配置 prompt。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-firebase-authentication`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/firebase-authentication/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
安装
“安装”章节你可以使用我们的 AI 辅助设置来安装插件。使用以下命令将 Capgo skills 添加到你的 AI 工具中:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins然后使用以下 prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-firebase-authentication` plugin in my project.如果你更想手动设置,请运行以下命令安装插件,并按照下方各平台的说明操作:
bun add @capgo/capacitor-firebase-authenticationnpx cap sync导入
“导入”章节import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';快速入门
章节标题为“快速入门”import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.applyActionCode({ oobCode: 'oob-code' });示例:confirmPasswordReset
章节标题:“示例:confirmPasswordReset”import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.confirmPasswordReset({ oobCode: 'oob-code', newPassword: 'new-password',});示例:confirmVerificationCode
章节标题:“示例:confirmVerificationCode”import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.confirmVerificationCode({ verificationId: 'phoneCodeSent', verificationCode: 'phoneCodeSent',});// The result holds sensitive values: use it without logging it.常见坑点
章节标题为“常见陷阱”- 监听器: 在页面卸载时移除句柄。
- 原生同步:运行
npx cap sync在插件升级后。 - 唯一可信来源:信任
src/definitions.ts在 GitHub 仓库中。
API 概览
章节标题:“API 概览”applyActionCode
“applyActionCode” 章节应用通过电子邮件发送给用户的验证 code。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.applyActionCode({ oobCode: 'oob-code' });confirmPasswordReset
“confirmPasswordReset” 章节完成重置密码流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.confirmPasswordReset({ oobCode: 'oob-code', newPassword: 'new-password',});confirmVerificationCode
“confirmVerificationCode” 章节完成手机号验证流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.confirmVerificationCode({ verificationId: 'phoneCodeSent', verificationCode: 'phoneCodeSent',});// The result holds sensitive values: use it without logging it.createUserWithEmailAndPassword
“createUserWithEmailAndPassword” 章节使用邮箱和密码创建新用户账号。 如果账号创建成功,用户将自动登录。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.createUserWithEmailAndPassword({ email: 'user@example.com', password: 'password',});// The result holds sensitive values: use it without logging it.deleteUser
“deleteUser” 章节删除用户并退出登录。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.deleteUser();fetchSignInMethodsForEmail
“fetchSignInMethodsForEmail” 章节获取某个邮箱地址的登录方式。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.fetchSignInMethodsForEmail({ email: 'user@example.com' });console.log(result);getCurrentUser
“getCurrentUser” 章节获取当前已登录的用户。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.getCurrentUser();// The result holds sensitive values: use it without logging it.getPendingAuthResult
“getPendingAuthResult” 章节返回 SignInResult 如果您的应用启动了 Web 登录流程,而操作系统在后台清理了该应用。
仅适用于 Android。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.getPendingAuthResult();// The result holds sensitive values: use it without logging it.getIdToken
“getIdToken” 章节获取当前登录用户的 Firebase Auth ID Token。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.getIdToken();// The result holds sensitive values: use it without logging it.getIdTokenResult
“getIdTokenResult” 章节返回反序列化后的 JSON Web Token (JWT),用于在 Firebase 服务中标识用户。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.getIdTokenResult();// The result holds sensitive values: use it without logging it.getRedirectResult
“getRedirectResult” 章节返回 SignInResult (来自基于重定向的登录流程)。
如果登录失败,则会报错。
如果未调用重定向操作,则返回一个 SignInResult 用户为 null。
仅 Web 端可用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.getRedirectResult();// The result holds sensitive values: use it without logging it.getTenantId
标题为 “getTenantId” 的章节获取租户 ID。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.getTenantId();console.log(result);isSignInWithEmailLink
标题为 “isSignInWithEmailLink” 的章节检查传入链接是否为适用于……的电子邮件链接登录 signInWithEmailLink.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.isSignInWithEmailLink({ emailLink: 'https://example.com' });// The result holds sensitive values: use it without logging it.linkWithApple
标题为 “linkWithApple” 的章节将用户账号与 Apple 身份验证提供商绑定。
用户必须已在原生层登录。
该 skipNativeAuth 该配置选项在此处不起作用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithApple();// The result holds sensitive values: use it without logging it.linkWithEmailAndPassword
“linkWithEmailAndPassword” 章节将用户账号与 Email 身份验证提供商绑定。
用户必须已在原生层登录。
该 skipNativeAuth 该配置选项在此处不起作用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithEmailAndPassword({ email: 'user@example.com', password: 'password',});// The result holds sensitive values: use it without logging it.linkWithEmailLink
“linkWithEmailLink” 章节将用户账号与 Email 身份验证提供商绑定。
用户必须已在原生层登录。
该 skipNativeAuth 该配置选项在此处不起作用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithEmailLink({ email: 'user@example.com', emailLink: 'https://example.com',});// The result holds sensitive values: use it without logging it.linkWithFacebook
“linkWithFacebook” 章节将用户账号与 Facebook 身份验证提供商绑定。
用户必须已在原生层登录。
该 skipNativeAuth 该配置选项在此处不起作用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithFacebook();// The result holds sensitive values: use it without logging it.linkWithGameCenter
“linkWithGameCenter” 章节将用户账号与 Game Center 身份验证提供商关联。
用户必须已在原生层登录。
该 skipNativeAuth 该配置选项在此处不起作用。
仅 iOS 端可用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithGameCenter();// The result holds sensitive values: use it without logging it.linkWithGithub
“linkWithGithub” 章节将用户账号与 GitHub 身份验证提供商关联。
用户必须已在原生层登录。
该 skipNativeAuth 该配置选项在此处不起作用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithGithub();// The result holds sensitive values: use it without logging it.linkWithGoogle
标题为 “linkWithGoogle” 的章节将用户账号与 Google 身份验证提供商关联。
用户必须已在原生层登录。
该 skipNativeAuth 该配置选项在此处不起作用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithGoogle();// The result holds sensitive values: use it without logging it.linkWithMicrosoft
标题为 “linkWithMicrosoft” 的章节将用户账号与 Microsoft 身份验证提供商关联。
用户必须已在原生层登录。
该 skipNativeAuth 该配置选项在此处不起作用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithMicrosoft();// The result holds sensitive values: use it without logging it.linkWithOpenIdConnect
“linkWithOpenIdConnect” 章节将用户账号与 OpenID Connect 提供商关联。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithOpenIdConnect({ providerId: 'provider-id-123' });// The result holds sensitive values: use it without logging it.linkWithPhoneNumber
“linkWithPhoneNumber” 章节将用户账号与手机号身份验证提供商关联。
用户必须已在原生层登录。
该 skipNativeAuth 该配置选项在此处不起作用。
使用 phoneVerificationCompleted 验证完成时接收通知的监听器。
使用 phoneVerificationFailed 验证失败时接收通知的监听器。
使用 phoneCodeSent 用于获取验证 ID 的监听器。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.linkWithPhoneNumber({ phoneNumber: "+16505550101" });linkWithPlayGames
“linkWithPlayGames” 章节将用户账号与 Play Games 身份验证提供商关联。
用户必须已在原生层登录。
该 skipNativeAuth 该配置选项在此处不起作用。
仅适用于 Android。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithPlayGames();// The result holds sensitive values: use it without logging it.linkWithTwitter
“linkWithTwitter” 章节将用户账号与 Twitter 身份验证提供商关联。
用户必须已在原生层登录。
该 skipNativeAuth 该配置选项在此处不起作用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithTwitter();// The result holds sensitive values: use it without logging it.linkWithYahoo
标题为 “linkWithYahoo” 的章节将用户账号与 Yahoo 身份验证提供商关联。
用户必须已在原生层登录。
该 skipNativeAuth 该配置选项在此处不起作用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.linkWithYahoo();// The result holds sensitive values: use it without logging it.reload
标题为 “reload” 的章节如果已登录,则重新加载用户账号数据。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.reload();revokeAccessToken
标题为 “revokeAccessToken” 的章节撤销指定的 access token。目前仅支持 Apple OAuth access token。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.revokeAccessToken({ token: 'token-123' });sendEmailVerification
“sendEmailVerification” 章节向当前已登录用户发送验证邮件。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.sendEmailVerification();sendPasswordResetEmail
“sendPasswordResetEmail” 章节发送密码重置邮件。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.sendPasswordResetEmail({ email: 'user@example.com' });sendSignInLinkToEmail
“sendSignInLinkToEmail” 章节向指定邮箱的用户发送登录邮件链接。
若要通过邮件链接完成登录,请调用 signInWithEmailLink 并传入用户收到的邮件中的邮箱地址和邮件链接。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.sendSignInLinkToEmail({ email: 'user@example.com', actionCodeSettings: { url: 'https://example.com' },});setLanguageCode
“setLanguageCode” 章节设置身份验证操作面向用户的语言 code。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.setLanguageCode({ languageCode: "en-US" });setPersistence
“setPersistence” 章节设置当前已保存的身份验证会话的持久化类型。
仅 Web 端可用。
import { FirebaseAuthentication, Persistence } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.setPersistence({ persistence: Persistence.IndexedDbLocal });setTenantId
“setTenantId” 章节设置租户 ID。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.setTenantId({ tenantId: 'tenant-id-123' });signInAnonymously
“signInAnonymously” 章节以匿名用户身份登录。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInAnonymously();// The result holds sensitive values: use it without logging it.signInWithApple
“signInWithApple” 章节启动 Apple 登录流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithApple();// The result holds sensitive values: use it without logging it.signInWithCustomToken
“signInWithCustomToken” 章节启动 Custom Token 登录流程。
此方法不能与以下内容结合使用: skipNativeAuth 在 Android 和 iOS 上。
在这种情况下,你必须直接使用 signInWithCustomToken Firebase JS SDK 的 interface。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithCustomToken({ token: 'token-123' });// The result holds sensitive values: use it without logging it.signInWithEmailAndPassword
“signInWithEmailAndPassword” 章节启动邮箱和密码登录流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithEmailAndPassword({ email: 'user@example.com', password: 'password',});// The result holds sensitive values: use it without logging it.signInWithEmailLink
“signInWithEmailLink” 章节使用邮箱和登录邮件链接登录。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithEmailLink({ email: 'user@example.com', emailLink: 'https://example.com',});// The result holds sensitive values: use it without logging it.signInWithFacebook
“signInWithFacebook” 章节启动 Facebook 登录流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithFacebook();// The result holds sensitive values: use it without logging it.signInWithGameCenter
“signInWithGameCenter” 章节启动 Game Center 登录流程。
仅限 iOS 使用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithGameCenter();// The result holds sensitive values: use it without logging it.signInWithGithub
“signInWithGithub” 章节启动 GitHub 登录流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithGithub();// The result holds sensitive values: use it without logging it.signInWithGoogle
“signInWithGoogle” 章节启动 Google 登录流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithGoogle();// The result holds sensitive values: use it without logging it.signInWithMicrosoft
“signInWithMicrosoft” 章节启动 Microsoft 登录流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithMicrosoft();// The result holds sensitive values: use it without logging it.signInWithOpenIdConnect
“signInWithOpenIdConnect” 章节启动 OpenID Connect 登录流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithOpenIdConnect({ providerId: 'provider-id-123' });// The result holds sensitive values: use it without logging it.signInWithPhoneNumber
“signInWithPhoneNumber” 章节启动使用手机号的登录流程。
使用 phoneVerificationCompleted 验证完成时接收通知的监听器。
使用 phoneVerificationFailed 验证失败时接收通知的监听器。
使用 phoneCodeSent 用于获取验证 ID 的监听器。
仅适用于 Android 和 iOS。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signInWithPhoneNumber({ phoneNumber: "+16505550101" });signInWithPlayGames
标题为“signInWithPlayGames”的章节启动 Play Games 登录流程。
仅适用于 Android。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithPlayGames();// The result holds sensitive values: use it without logging it.signInWithTwitter
标题为“signInWithTwitter”的章节启动 Twitter 登录流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithTwitter();// The result holds sensitive values: use it without logging it.signInWithYahoo
“signInWithYahoo” 章节启动 Yahoo 登录流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.signInWithYahoo();// The result holds sensitive values: use it without logging it.signOut
“signOut” 章节启动登出流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.signOut();unlink
“unlink” 章节从用户账号中解绑身份提供商。
import { FirebaseAuthentication, ProviderId } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.unlink({ providerId: ProviderId.APPLE });// The result holds sensitive values: use it without logging it.updateEmail
“updateEmail” 章节更新当前登录用户的邮箱地址。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.updateEmail({ newEmail: 'user@example.com' });updatePassword
“updatePassword” 章节更新当前已登录用户的密码。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.updatePassword({ newPassword: 'new-password' });updateProfile
“updateProfile” 章节更新用户个人资料数据。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.updateProfile({ displayName: 'display', photoUrl: 'https://example.com',});useAppLanguage
“useAppLanguage” 章节将面向用户的语言 code 设置为应用的默认语言。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.useAppLanguage();useEmulator
标题为 “useEmulator” 的章节配置应用以连接 Authentication 模拟器。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.useEmulator({ host: "127.0.0.1" });verifyBeforeUpdateEmail
“verifyBeforeUpdateEmail” 章节先验证新邮箱地址,再更新当前登录用户的邮箱地址。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.verifyBeforeUpdateEmail({ newEmail: 'user@example.com' });checkAppTrackingTransparencyPermission
“checkAppTrackingTransparencyPermission” 章节检查应用追踪透明度(App Tracking Transparency)的当前状态。
仅 iOS 端可用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.checkAppTrackingTransparencyPermission();console.log(result);requestAppTrackingTransparencyPermission
“requestAppTrackingTransparencyPermission” 章节打开系统对话框以授权应用追踪透明度。
注意: 用户可能已在设备设置中禁用了追踪请求,请参阅 Apple 官方文档.
仅限 iOS 使用。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
const result = await FirebaseAuthentication.requestAppTrackingTransparencyPermission();console.log(result);类型参考
“类型参考” 章节ApplyActionCodeOptions
标题为 “ApplyActionCodeOptions” 的章节export interface ApplyActionCodeOptions { /** * A verification code sent to the user. * * @since 0.2.2 */ oobCode: string;}ConfirmPasswordResetOptions
标题为 “ConfirmPasswordResetOptions” 的章节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;}ConfirmVerificationCodeOptions
标题为 “ConfirmVerificationCodeOptions” 的章节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;}SignInResult
标题为 “SignInResult” 的章节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[];}GetCurrentUserResult
“GetCurrentUserResult” 章节export interface GetCurrentUserResult { /** * The currently signed-in user, or null if there isn't any. * * @since 0.1.0 */ user: User | null;}GetIdTokenOptions
“GetIdTokenOptions” 章节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 发生变化时,请重新运行 sync。
从入门指南继续
“从入门指南继续”章节如果你正在使用 快速入门 用来规划身份验证和账户流程,并将它与 @capgo/capacitor-social-login 在 @capgo/capacitor-social-login 中查看实现细节, @capgo/capacitor-passkey 有关 @capgo/capacitor-passkey 的实现细节, @capgo/capacitor-native-biometric 有关 @capgo/capacitor-native-biometric 的实现细节, 双因素认证 有关双因素认证的实现细节,以及 SSO (企业版) 有关 SSO (Enterprise) 的实现细节。