firebase-auth-basics
Skill506 starsChanged 5 months agoApache-2.0View on GitHub
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.
4 other projects use a version of this, 4 of them edited.
Adopted by
Most recently taken up by
- renansouza12/mixtape-edited, first seen Oct 13, 2026
- baliadventours/Tripbone-SaaS-Productionedited, first seen Aug 5, 2026
- VolantTyler/Cognitive-Bridge-Antigravityedited, first seen Jun 5, 2026
- adrianhajdin/skildedited, first seen Apr 15, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 4
- adrianhajdin/skild★ 4195% same
- VolantTyler/Cognitive-Bridge-Antigravity★ 191% same
- baliadventours/Tripbone-SaaS-Production★ 093% same
- renansouza12/mixtape-★ 091% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- extension-to-functions-codebaseSkill
- firebase-ai-logic-basicsSkill
- firebase-analyticsSkill
- firebase-app-hosting-basicsSkill
- firebase-basicsSkill
- firebase-crashlyticsSkill
- firebase-data-connectSkill
- firebase-firestoreSkill
- firebase-hosting-basicsSkill
- firebase-remote-config-basicsSkill
- firebase-security-rules-auditorSkill
- firestore-rules-creationSkill
- xcode-project-setupSkill
The file
We split this skill into the rules it gives an agent
3 rules. 1 is common, 1 is distinctive, and 1 is very specific to this project.
1
Common
Most of the 4 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 49
When a user signs in, they receive an ID Token (JWT).
- Common: line 62
Only Google Sign In, anonymous auth, and email/password auth can be enabled via CLI.
- Very specific: line 98
CRITICAL: After configuring firebase.json, you MUST deploy the auth configuration to the Firebase backend for the changes to take effect.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Prerequisites
- Firebase Project: Created via
npx -y firebase-tools@latest projects:create(seefirebase-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://my-project-id.firebaseapp.com/__/auth/handler",
"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, addhttp://localhosttoauthorizedRedirectUrisinfirebase.json(or ensurelocalhostis included in the Authorized Domains list in the Firebase Console under Authentication > Settings > Authorized domains). CRITICAL: Do NOT include the port number inauthorizedRedirectUris(e.g., usehttp://localhost, NOThttp://localhost:9090orhttp://localhost:4000), and do NOT include the protocol or port number in the Console Authorized Domains list (uselocalhost). Including a port number inauthorizedRedirectUriscausesfirebase deploy --only authto fail withINVALID_AUTHORIZED_DOMAIN.
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 authOption 2. Enabling Authentication in Console
Enable other providers in the Firebase Console.
- Go to the https://console.firebase.google.com/project/_/authentication/providers
- Select your project.
- 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.
iOS (Swift) See references/ios_setup.md.
3. Security Rules
Secure your data using request.auth in Firestore/Storage rules.
See references/security_rules.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

