firebase-auth-basics

द्वारा firebase

Firebase Authentication को कई पहचान प्रदाताओं और सुरक्षित डेटा एक्सेस नियमों के साथ सेट अप करें। ईमेल/पासवर्ड, फ़ोन नंबर, अनाम, फ़ेडरेटेड प्रदाताओं (Google, Facebook, Twitter, GitHub, Microsoft, Apple) और कस्टम ऑथ इंटीग्रेशन का समर्थन करता है। प्रत्येक प्रमाणित उपयोगकर्ता को Firebase सेवाओं तक पहुँचने के लिए एक अद्वितीय ID और JWT-आधारित टोकन (अल्पकालिक ID टोकन और दीर्घकालिक रिफ्रेश टोकन) प्राप्त होते हैं। Google Sign In, अनाम और ईमेल

npx skills add https://github.com/firebase/agent-skills --skill firebase-auth-basics

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": "[email protected]",
        "authorizedRedirectUris": ["https://example.com", "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, ensure localhost is included in the Authorized Domains list in the Firebase Console or via the authorizedDomains field in firebase.json. CRITICAL: Do NOT include the protocol or port number in the Authorized Domains list (e.g., use localhost, NOT http://localhost:9090).

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:

npx -y firebase-tools@latest deploy --only auth

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.

Flutter See references/flutter_setup.md. Android (Kotlin) See references/client_sdk_android.md.

3. Security Rules

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

See references/security_rules.md.

firebase की और Skills

firebase-remote-config-basics
firebase
Firebase Remote Config के लिए व्यापक मार्गदर्शिका, जिसमें टेम्पलेट प्रबंधन और SDK उपयोग शामिल है। इस कौशल का उपयोग तब करें जब उपयोगकर्ता को Remote Config सेट अप करने, फीचर फ्लैग प्रबंधित करने, या ऐप व्यवहार को गतिशील रूप से अपडेट करने में सहायता की आवश्यकता हो।
officialdevelopmentapi
developing-genkit-dart
firebase
We need to translate the given English text to Hindi. The text describes a unified AI SDK for Dart. We must preserve product names, protocol names, URLs, numbers, technical terms. The name "developing-genkit-dart" is not in the text, so we don't include it. We translate only the text inside <text>. No extra commentary, labels, etc. Let's break down the text: "Unified AI SDK for Dart enabling code generation, structured outputs, tools, flows, and agents. Provides core APIs for generation, tool definition, flow orchestration, embeddings, and streaming with a single interface Includes 8+ plugins for LLM providers (Google Gemini, Anthropic Claude, OpenAI GPT), Firebase AI, Model Context Protocol, Chrome browser integration, and HTTP server hosting via Shelf Built-in CLI with local development UI for flow execution, tracing, model experimentation, and..." We need to translate into Hindi. Keep technical terms like SDK, APIs, plugins, LLM, Google Gemini, Anthropic Claude, OpenAI GPT, Firebase AI, Model Context Protocol, Chrome,
official
developing-genkit-go
firebase
Genkit का उपयोग करके Go में AI-संचालित एप्लिकेशन विकसित करें। जब उपयोगकर्ता Genkit का उपयोग करके Go में AI सुविधाएँ, एजेंट, फ़्लो या टूल बनाने के लिए कहे, या जब…
official
developing-genkit-js
firebase
Genkit फ्लो, टूल और मल्टी-मॉडल सपोर्ट के साथ AI-संचालित Node.js/TypeScript एप्लिकेशन बनाएं। Genkit प्रदाता-अज्ञेयवादी है; प्लगइन के माध्यम से Google AI, OpenAI, Anthropic, Ollama और अन्य LLM प्रदाताओं को सपोर्ट करता है। Zod का उपयोग करके टाइप-सेफ स्कीमा के साथ फ्लो परिभाषित करें, जनरेशन अनुरोध निष्पादित करें और TypeScript में मल्टी-स्टेप AI वर्कफ़्लो बनाएं। Genkit CLI v1.29.0+ आवश्यक है; हाल के प्रमुख API परिवर्तनों के कारण
official
developing-genkit-python
firebase
जेनकिट का उपयोग करके पायथन में AI-संचालित एप्लिकेशन विकसित करें। इसका उपयोग तब करें जब उपयोगकर्ता पायथन में जेनकिट, AI एजेंट, फ्लो या टूल के बारे में पूछता है, या जब जेनकिट का सामना होता है…
official
firebase-ai-logic
firebase
वेब ऐप्स के लिए क्लाइंट-साइड जेमिनी एकीकरण, जिसमें मल्टीमॉडल अनुमान, स्ट्रीमिंग और ऑन-डिवाइस हाइब्रिड निष्पादन शामिल है। केवल-टेक्स्ट और मल्टीमॉडल इनपुट (चित्र, ऑडियो, वीडियो, PDF) का समर्थन करता है; 20 MB से अधिक की फ़ाइलें क्लाउड स्टोरेज के माध्यम से रूट होती हैं। इसमें स्वचालित इतिहास वाले चैट सत्र, रीयल-टाइम प्रदर्शन के लिए स्ट्रीमिंग प्रतिक्रियाएँ और सं
official
firebase-ai-logic-basics
firebase
फायरबेस AI लॉजिक (Gemini API) को वेब एप्लिकेशन में एकीकृत करने के लिए आधिकारिक कौशल। सेटअप, मल्टीमॉडल इन्फ्रेंस, संरचित आउटपुट और सुरक्षा को शामिल करता है।
official
firebase-app-hosting-basics
firebase
Firebase App Hosting के साथ Next.js, Angular और अन्य समर्थित फ्रेमवर्क का उपयोग करके फुल-स्टैक वेब ऐप्स को डिप्लॉय और प्रबंधित करें। Blaze मूल्य योजना पर Firebase प्रोजेक्ट आवश्यक है; सर्वर-साइड रेंडरिंग (SSR) और इंक्रीमेंटल स्टैटिक रीजनरेशन (ISR) वर्कफ़्लो का समर्थन करता है। बैकएंड सेटअप के लिए वैकल्पिक apphosting.yaml के साथ firebase.json कॉन्फ़िगरेशन के माध्यम से डिप्लॉय करें, या GitHub एकीकरण के माध्यम से स्वचालित "git push to deploy
official