본문으로 건너뛰기
cccskills
무료GitHub에 공개

firebase-auth-internal-app

Integrate Firebase Auth (authentication + domain restriction) into internal applications. Includes domain restriction via Blocking Functions and user registration to Firestore.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구Firebase
설치 방법 보기

포함된 파일(4)

  • SKILL.md3.7 KB
  • references/blocking_functions.md2.3 KB
  • references/custom_claims.md1.4 KB
  • references/security_rules.md2.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Integrate Firebase Authentication into an internal application. Implement the following components.

Prerequisites

  • A Firebase project has been created
  • Firebase CLI is installed and logged in
  • Firestore is enabled
  • The firebase-auth-basics skill is available

Implementation

1. Authentication Setup

Follow the firebase-auth-basics skill to:

  1. Use AskUserQuestion to ask the user which authentication method to use
  2. Provision the selected authentication method (firebase.json configuration or manual setup via Firebase Console)
  3. Implement client-side authentication (initialization, sign-in, auth state monitoring, sign-out)

Refer to firebase-auth-basics for all authentication method options, provisioning steps, and client SDK implementation examples.

For non-web platforms (iOS / Android / Flutter / Unity, etc.), fetch the relevant platform information from the official documentation at https://firebase.google.com/docs/auth.

2. Domain Restriction via Blocking Functions

Implement based on references/blocking_functions.md.

Using beforeUserCreated, implement the following:

  • Determine the domain from the user's email address
  • If the domain is allowed, register user information in the Firestore users collection
  • If the domain is not allowed, return an error to reject sign-in
  • Set the initial role in Custom Claims via the return value (return { customClaims: ... }), so it is included in the ID token from the first sign-in

Use AskUserQuestion to ask the user for the allowed email domain(s) (e.g., example.com). For multiple domains, ask for comma-separated input.

Also confirm the following:

  • Fields to store in the users collection (default: email, role, createdAt)

3. Permission Management via Custom Claims

Implement based on references/custom_claims.md.

Use onDocumentWritten to monitor changes to users/{id} documents and sync permission information to Custom Claims:

  • Initial claims are set by the beforeUserCreated return value (section 2); this trigger handles subsequent updates only
  • When the permission field in a users document is updated, reflect it in the ID token via setCustomUserClaims
  • On the client side, Custom Claims in the token can be used for permission control

Default role values:

  • admin: Administrator
  • user: Regular user
  • pending: Pending approval
  • deleted: Deleted

The initial role for users who pass domain restriction is user. Confirm the following with the user:

  • The permission field name to store in Custom Claims (default: role)
  • Whether to customize the role types (default: admin, user, pending, deleted)

4. Firestore Security Rules

Implement based on references/security_rules.md.

Define helper functions isUser() and isAdmin() based on the role Custom Claim, and set up security rules for the users collection as a minimum.

The application's other collections should also use isUser() and isAdmin() for access control.

Notes

  • If any prerequisites are not met, notify the user which ones are missing before proceeding
  • Always confirm environment-specific values such as allowed domains and app name with the user before setting them
  • Blocking Functions use Cloud Functions for Firebase (2nd gen)
  • Writing to the users collection uses the firebase-admin SDK (server-side)

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

browser

무료

chrome-devtools-mcp の CLI (`chrome-devtools`) を使ったブラウザ操作の総合スキル。既存ブラウザへの attach / 使い捨てテストブラウザ / ログイン状態を保持する永続プロファイルのいずれかをユーザーに必ず確認した上でサーバを立ち上げ、スナップショット取得・クリック・入力・ナビゲーション・スクショ・ネットワーク監視などを行う。

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tanabee/skills32026년 10월 17일 업데이트

capture

무료

checklist の「UI 撮影台本」に沿って UI のスクリーンショットを撮影し、前後比較(compare.html)用の before / after 素材を保存する。「実装前の UI を撮っておいて」「after のスクショを撮って」などの依頼で発火する。

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tanabee/skills32026년 10월 17일 업데이트

Read and analyze log entries from Cloud Logging using the gcloud CLI.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tanabee/skills32026년 10월 17일 업데이트

Codex 公式プラグイン (codex-plugin-cc) のネイティブレビューでコードレビューを実施する。PR 番号指定時は PR を、無指定時は現在ブランチとベースブランチの差分をレビューする。

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tanabee/skills32026년 10월 17일 업데이트

copy

무료

指定された内容をクリップボードにコピーするスキル。ファイルパスならその中身を、テキストならそのまま、会話中の直前の出力(コマンド結果・生成コード・URL など)を指す場合はその内容を pbcopy でコピーする。ユーザーが「コピーして」「クリップボードに入れて」などコピーの意図を示したら必ず使用する。

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tanabee/skills32026년 10월 17일 업데이트

GitHub issue から PR のタイトルと説明文を作成する。

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tanabee/skills32026년 10월 17일 업데이트

tanabee의 스킬 모두 보기

이 스킬의 문제 신고