firebase-auth-basics 是什么?
firebase-auth-basics 指导接入Firebase Authentication,实现登录、用户身份及基于身份的数据访问。它区分身份提供商配置、客户端SDK和数据安全规则,登录成功并不自动赋予所有数据权限。
中文说明由本站依据来源整理;英文原文保留在页面下方。
适合用在
- Web、Flutter、Android或iOS应用需要邮箱、Google等登录,或用户身份与数据访问规则。
这些情况不适合
- 把用户可自行提交的uid或前端登录状态当作可信后端授权。
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
firebase-auth-basics,然后按本页使用示例提供材料。
展开并复制给 Codex 的安装指令
安装并检查 firebase-auth-basics
请在 Codex 的当前工作环境中安装并检查 firebase-auth-basics 这个 Skill。
项目身份:firebase/agent-skills / firebase-auth-basics
来源:https://github.com/firebase/agent-skills/blob/99954a30898bb5ddc8152ee10e124dc3b4106bf7/skills/firebase-auth-basics/SKILL.md
已定位的源文件:skills/firebase-auth-basics/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 firebase-auth-basics
请在 Claude Code 的当前工作环境中安装并检查 firebase-auth-basics 这个 Skill。
项目身份:firebase/agent-skills / firebase-auth-basics
来源:https://github.com/firebase/agent-skills/blob/99954a30898bb5ddc8152ee10e124dc3b4106bf7/skills/firebase-auth-basics/SKILL.md
已定位的源文件:skills/firebase-auth-basics/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 firebase-auth-basics
请在 Cursor Agent 的当前工作环境中安装并检查 firebase-auth-basics 这个 Skill。
项目身份:firebase/agent-skills / firebase-auth-basics
来源:https://github.com/firebase/agent-skills/blob/99954a30898bb5ddc8152ee10e124dc3b4106bf7/skills/firebase-auth-basics/SKILL.md
已定位的源文件:skills/firebase-auth-basics/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 firebase-auth-basics
请在 当前 Agent 的当前工作环境中安装并检查 firebase-auth-basics 这个 Skill。
项目身份:firebase/agent-skills / firebase-auth-basics
来源:https://github.com/firebase/agent-skills/blob/99954a30898bb5ddc8152ee10e124dc3b4106bf7/skills/firebase-auth-basics/SKILL.md
已定位的源文件:skills/firebase-auth-basics/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。装好以后,具体怎么用?
准备哪些材料
- 有明确Firebase项目、CLI登录与目标平台;选择实际登录提供商,并保留该平台SDK参考。
会得到什么
- 提供商配置、平台登录实现及相关数据规则,报告实际登录与授权验证范围。
实际使用顺序
- 确定提供商。该源版本给Google、匿名与邮箱密码登录提供firebase.json配置方式,其他提供商走控制台。
- 核对授权域名与重定向配置,按来源将Auth配置部署到目标项目后才期待后端生效。
- 读取对应Web、Flutter、Kotlin或Swift参考接入客户端,区分短期ID token与刷新token;数据规则基于request.auth判断访问。
从一个具体任务开始
本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。
复制一个具体任务
用 firebase-auth-basics 为我现有Web项目规划Google登录。先核对Firebase项目、当前SDK与授权域名,再给出对应配置和客户端修改。登录后只允许用户读取自己的资料,请同时核对request.auth规则。未经我的部署授权先停在本地可审阅改动。预期提供商、客户端与数据权限三部分一致;是否登录成功需真实运行确认,本站未执行本例。
使用条件与边界
- 来源中CLI支持的提供商范围属于该版本说明,实际执行前仍需核对当前CLI帮助。
- ID token识别身份,数据访问还依赖服务端或Firebase规则,不能省略授权。
常见问题
Google登录弹窗一开就关怎么办?
来源指出unauthorized-domain可由域名未授权造成。按实际错误核对配置:控制台填localhost时不带协议与端口;该源的authorizedRedirectUris示例使用http://localhost且不带端口。
用户登录了,为什么读不到数据?
登录和数据授权是不同环节,应检查request.auth及所有权条件,不能为了读通就把规则开放给所有人。
来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-19T19:32:10.677Z
- 中文使用说明
- 已针对下方源文件版本整理用途、用法和常见问题
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料
skills/firebase-auth-basics/SKILL.md · 抓取时间 2026-11-19T19:32:10.677Z
以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。
抓取成功不代表已完成安装或任务测试。
Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.
查看源文件章节 / Source sections
- 前置条件 / Prerequisites
- 原文:Core Concepts
- 原文:Users
- 原文:Identity Providers
- 原文:Tokens
- 工作流程 / Workflow
- 原文:1. Provisioning
- 原文:Option 1. Enabling Authentication via CLI
- 原文:Option 2. Enabling Authentication in Console
- 原文:2. Client Setup & Usage
- 原文:3. Security Rules
前置条件 / Prerequisites
- **Firebase Project**: Created via `npx -y firebase-tools@latest projects:create` (see `firebase-basics`). - **Firebase CLI**: Installed and logged in (see `firebase-basics`).
原文:Core Concepts
Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app.
原文:Users
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.
原文:Identity Providers
Firebase Auth supports multiple ways to sign in: - **Email/Password**: Basic email and password authentication. - **Federated Identity Providers**: Google, Facebook, Twitter, GitHub, Microsoft, Apple, etc. - **Phone Number**: SMS-based authentication. - **Anonymous**: Temporary guest accounts that can be linked to permanent accounts later. - **Custom Auth**: Integrate with your existing auth system. Google Sign In is recommended as a good and secure default provider.
原文:Tokens
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. - **ID Token**: Short-lived (1 hour), verifies identity. - **Refresh Token**: Long-lived, used to get new ID tokens.
原文:Option 1. Enabling Authentication via CLI
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://my-project-id.firebaseapp.com/__/auth/handler", "http://localhost" ] } } } } ``` > [!NOTE] If the Google Sign-In popup opens and immediately closes with the > error `[firebase_auth/unauthorized-domain]`, it means the domain is not > authorized. For local development, add `http://localhost` to > `authorizedRedirectUris` in `firebase.json` (or ensure `localhost` is included > in the **Authorized Domains** list in the Firebase Console under > Authentication > Settings > Authorized domains). **CRITICAL**: Do NOT include > the port number in `authorizedRedirectUris` (e.g., use `http://localhost`, NOT > `http://localhost:9090` or `http://localhost:4000`), and do NOT include the > protocol or port number in the Console Authorized Domains list (use > `localhost`). Including a port number in `authorizedRedirectUris` causes > `firebase deploy --only auth` to fail with `INVALID_AUTHORIZED_DOMAIN`. **CRITICAL**: After configuring `firebase.json`, you MUST deploy the auth configuration to the Firebase backend for the changes to take effect. This is essential for auth providers like Google Sign-In, email/password, etc. to auto-generate the necessary OAuth clients for your app platforms. Run: ```bash npx -y firebase-tools@latest deploy --only auth ```
文件 SHA256:247aea2de7ef99b5fac1151082821bebee0b3153f385f640f28f09eba38c8c0b
仓库许可证记录:Apache-2.0;repository-license-recorded-scope-unverified,查看来源。
Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using…
这份历史简介在采集时已截断;完整用途和触发条件需打开来源核对。
历史收录数据
| Skill标识 | firebase-auth-basics |
|---|---|
| 来源仓库 | firebase/agent-skills |
| 榜单快照 | 2026-07-28 |
| 榜单口径 | Skills.sh累计安装量 |
| 快照名次 | 207 |
| 快照累计安装量 | 115308 |
历史资料说明
- 所保留的来源简介在采集时已截断;完整触发条件、依赖及排除项须阅读源文件,本站不补写缺失部分。
- 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。
此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。
