firebase-auth-basics

Configure Firebase Authentication providers and implement sign-in flows across web, Android, iOS, and Flutter.

Updated May 21, 2025
One-click install
npx skills add https://github.com/albertmartorell1975/MeteoMartoCompose --skill firebase-auth-basics-albertmartorell1975
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: firebase-auth-basics
Source: https://github.com/albertmartorell1975/MeteoMartoCompose/tree/main/.agents/skills/firebase-auth-basics
Command: npx skills add https://github.com/albertmartorell1975/MeteoMartoCompose --skill firebase-auth-basics-albertmartorell1975

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up Firebase Authentication involves many platform-specific steps—enabling providers, configuring authorized domains, initializing SDKs, and writing security rules—and small misconfigurations cause cryptic errors like unauthorized-domain failures or app crashes. ## Core Features & Use Cases - Provider Provisioning: Enable Email/Password, Google, anonymous, and other sign-in providers via the Firebase CLI or Console, including firebase.json auth configuration and deployment. - Platform Client Setup: Reference guides for Web (JavaScript), Android (Kotlin/Jetpack Compose), iOS (Swift), and Flutter, covering initialization, sign-up, sign-in, auth state listeners, and sign-out. - Security Rules: Apply request.auth checks in Firestore and Storage rules to restrict data access by user identity, ownership, or email verification. - Use Case: Add Google Sign-In to an Android app by enabling the provider via CLI, deploying the auth config, and wiring up FirebaseAuth in a Compose activity. ## Quick Start Set up Firebase Authentication with Google Sign-In and email/password login for my app, including the client SDK integration and security rules.

Frequently Asked Questions about firebase-auth-basics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable Firebase Authentication providers via CLI?▼

Add an auth block to firebase.json specifying providers like anonymous, emailPassword, and googleSignIn, then run firebase deploy --only auth. Only Google, anonymous, and email/password can be enabled via CLI; other providers require the Firebase Console.

How do I add Firebase Auth to an Android Kotlin app?▼

Add the Firebase BoM and firebase-auth dependency in build.gradle.kts, then initialize Firebase.auth in your Activity. Use createUserWithEmailAndPassword for sign-up, signInWithEmailAndPassword for login, and auth.currentUser to check sign-in state.

Why does Google Sign-In fail with auth/unauthorized-domain?▼

The error occurs when your app's domain is not in the Firebase project's Authorized Domains list. Add the domain (e.g., localhost) in the Firebase Console or firebase.json, without protocol or port—use localhost, not http://localhost:9090.

Does Firebase Auth work with Flutter Web?▼

Yes, but google_sign_in 7.x requires initialization with a clientId on web or the app hangs. A common workaround is skipping GoogleSignIn initialization on web and using FirebaseAuth's signInWithPopup with GoogleAuthProvider instead.

How do I restrict Firestore data access to signed-in users?▼

Use request.auth in security rules: allow read, write: if request.auth != null restricts access to authenticated users. You can also match request.auth.uid against document IDs or owner fields for per-user data isolation.

Why does my iOS app crash when calling Auth.auth()?▼

The crash happens when Auth.auth() is initialized inline before FirebaseApp.configure() runs. Use lazy initialization (lazy var auth = Auth.auth()) or create the auth manager only after Firebase configuration completes.