firebase-auth-basics by firebase/agent-skills
npx skills add https://github.com/firebase/agent-skills --skill firebase-auth-basicsnpx -y firebase-tools@latest projects:create 创建(参见 firebase-basics)。firebase-basics)。Firebase Authentication 提供后端服务、易于使用的 SDK 和现成的 UI 库,用于对应用的用户进行身份验证。
用户是可以登录到您的应用的实体。每个用户由一个唯一的 ID (uid) 标识,该 ID 保证在所有身份提供者中都是唯一的。用户属性包括:
uid:唯一标识符。email:用户的电子邮件地址(如果可用)。displayName:用户的显示名称(如果可用)。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
photoURL:用户照片的 URL(如果可用)。emailVerified:布尔值,指示电子邮件是否已验证。Firebase Auth 支持多种登录方式:
Google 登录被推荐为良好且安全的默认提供者。
用户登录时,会收到一个 ID 令牌 (JWT)。该令牌用于在向 Firebase 服务(Realtime Database、Cloud Storage、Firestore)或您自己的后端发出请求时识别用户。
只有 Google 登录、匿名身份验证和电子邮件/密码身份验证可以通过 CLI 启用。对于其他提供者,请使用 Firebase 控制台。
通过在 firebase.json 中添加一个 'auth' 块来配置 Firebase Authentication:
{
"auth": {
"providers": {
"anonymous": true,
"emailPassword": true,
"googleSignIn": {
"oAuthBrandDisplayName": "您的品牌名称",
"supportEmail": "support@example.com",
"authorizedRedirectUris": ["https://example.com"]
}
}
}
}
在 Firebase 控制台中启用其他提供者。
Web 参见 references/client_sdk_web.md。
在 Firestore/Storage 规则中使用 request.auth 来保护您的数据。
每周安装量
2.8K
代码仓库
GitHub 星标数
182
首次出现
2026年2月17日
安全审计
安装于
gemini-cli2.7K
codex1.9K
opencode1.9K
github-copilot1.9K
amp1.9K
kimi-cli1.9K
npx -y firebase-tools@latest projects:create (see firebase-basics).firebase-basics).Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app.
A user is an entity that can sign in to your app. Each user is identified by a unique ID (uid) which is guaranteed to be unique across all providers. User properties include:
uid: Unique identifier.email: User's email address (if available).displayName: User's display name (if available).photoURL: URL to user's photo (if available).emailVerified: Boolean indicating if the email is verified.Firebase Auth supports multiple ways to sign in:
Google Sign In is recommended as a good and secure default provider.
When a user signs in, they receive an ID Token (JWT). This token is used to identify the user when making requests to Firebase services (Realtime Database, Cloud Storage, Firestore) or your own backend.
Only Google Sign In, anonymous auth, and email/password auth can be enabled via CLI. For other providers, use the Firebase Console.
Configure Firebase Authentication in firebase.json by adding an 'auth' block:
{
"auth": {
"providers": {
"anonymous": true,
"emailPassword": true,
"googleSignIn": {
"oAuthBrandDisplayName": "Your Brand Name",
"supportEmail": "support@example.com",
"authorizedRedirectUris": ["https://example.com"]
}
}
}
}
Enable other providers in the Firebase Console.
Web See references/client_sdk_web.md.
Secure your data using request.auth in Firestore/Storage rules.
See references/security_rules.md.
Weekly Installs
2.8K
Repository
GitHub Stars
182
First Seen
Feb 17, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli2.7K
codex1.9K
opencode1.9K
github-copilot1.9K
amp1.9K
kimi-cli1.9K
99,500 周安装