jpskill.com
🛠️ 開発・MCP コミュニティ

firebase-auth-basics

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.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o firebase-auth-basics.zip https://jpskill.com/download/19104.zip && unzip -o firebase-auth-basics.zip && rm firebase-auth-basics.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19104.zip -OutFile "$d\firebase-auth-basics.zip"; Expand-Archive "$d\firebase-auth-basics.zip" -DestinationPath $d -Force; ri "$d\firebase-auth-basics.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して firebase-auth-basics.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → firebase-auth-basics フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
3

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

前提条件

  • Firebase プロジェクト: npx -y firebase-tools@latest projects:create を使用して作成済みであること(firebase-basics を参照)。
  • Firebase CLI: インストール済みでログイン済みであること(firebase-basics を参照)。

コアコンセプト

Firebase Authentication は、ユーザーをアプリに認証するためのバックエンドサービス、使いやすい SDK、および既製の UI ライブラリを提供します。

ユーザー

ユーザーとは、アプリにサインインできるエンティティです。各ユーザーは、すべてのプロバイダーで一意であることが保証された一意の ID (uid) によって識別されます。 ユーザーのプロパティには以下が含まれます。

  • uid: 一意の識別子。
  • email: ユーザーのメールアドレス(利用可能な場合)。
  • displayName: ユーザーの表示名(利用可能な場合)。
  • photoURL: ユーザーの写真への URL(利用可能な場合)。
  • emailVerified: メールが確認済みであるかを示すブール値。

ID プロバイダー

Firebase Auth は、複数のサインイン方法をサポートしています。

  • Email/Password: 基本的なメールとパスワードによる認証。
  • Federated Identity Providers: Google、Facebook、Twitter、GitHub、Microsoft、Apple など。
  • Phone Number: SMS ベースの認証。
  • Anonymous: 後で永続的なアカウントにリンクできる一時的なゲストアカウント。
  • Custom Auth: 既存の認証システムとの統合。

Google Sign In は、優れた安全なデフォルトプロバイダーとして推奨されます。

トークン

ユーザーがサインインすると、ID トークン (JWT) を受け取ります。このトークンは、Firebase サービス (Realtime Database、Cloud Storage、Firestore) や独自のバックエンドにリクエストを行う際にユーザーを識別するために使用されます。

  • ID Token: 短命(1時間)、ID を検証します。
  • Refresh Token: 長命、新しい ID トークンを取得するために使用されます。

ワークフロー

1. プロビジョニング

オプション 1. CLI を介した認証の有効化

Google Sign In、匿名認証、およびメール/パスワード認証のみが CLI を介して有効にできます。他のプロバイダーについては、Firebase Console を使用してください。

firebase.json に 'auth' ブロックを追加して、Firebase Authentication を設定します。

{
  "auth": {
    "providers": {
      "anonymous": true,
      "emailPassword": true,
      "googleSignIn": {
        "oAuthBrandDisplayName": "Your Brand Name",
        "supportEmail": "support@example.com",
        "authorizedRedirectUris": ["https://example.com"]
      }
    }
  }
}

オプション 2. Console での認証の有効化

Firebase Console で他のプロバイダーを有効にします。

  1. https://console.firebase.google.com/project/_/authentication/providers にアクセスします。
  2. プロジェクトを選択します。
  3. 目的のサインインプロバイダー(例: Email/Password、Google)を有効にします。

2. クライアントのセットアップと使用

Web references/client_sdk_web.md を参照してください。

3. セキュリティルール

Firestore/Storage ルールで request.auth を使用してデータを保護します。

references/security_rules.md を参照してください。

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

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.

Workflow

1. Provisioning

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://example.com"]
      }
    }
  }
}

Option 2. Enabling Authentication in Console

Enable other providers in the Firebase Console.

  1. Go to the https://console.firebase.google.com/project/_/authentication/providers
  2. Select your project.
  3. Enable the desired Sign-in providers (e.g., Email/Password, Google).

2. Client Setup & Usage

Web See references/client_sdk_web.md.

3. Security Rules

Secure your data using request.auth in Firestore/Storage rules.

See references/security_rules.md.

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。