Data 7,274 installs

firebase-auth-basics

by firebase/agent-skills

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 content

Set up Firebase Authentication with multiple identity providers and secure data access rules.

- Supports email/password, phone number, anonymous, federated providers (Google, Facebook, Twitter, GitHub, Microsoft, Apple), and custom auth integration

- Each authenticated user receives a unique ID and JWT-based tokens (short-lived ID tokens and long-lived refresh tokens) for accessing Firebase services

- Enable providers via CLI for Google Sign In, anonymous, and email/password; use Firebase Console for additional federated providers

- Secure Firestore and Cloud Storage using request.auth in security rules to control data access based on user identity

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.