Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shrivastava-26/firebase_authorization


https://github.com/shrivastava-26/firebase_authorization

Last synced: 28 days ago
JSON representation

Awesome Lists containing this project

README

        

## Firebase Authorization🧑‍💻

This project demonstrates how to implement user authentication using Firebase Authentication. It provides an overview of the setup process, code snippets, and usage instructions.

## Table of Contents

- [Introduction](#introduction)
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Firebase Setup](#firebase-setup)
- [Usage](#usage)
- [Code Snippets](#code-snippets)
- [License](#license)

## Introduction

Firebase Authentication provides backend services for easy use of authentication, including social login providers like Google, Facebook, and email/password authentication. This project showcases how to set up and use Firebase Authentication in a web application.

## Getting Started

Follow the steps below to set up Firebase Authentication in your project.

### Installation

Make sure you have Node.js and npm installed on your machine. Create a new project directory and run the following command to initialize it:

mkdir firebase-auth-demo
cd firebase-auth-demo
npm init -y
Then, install the Firebase SDK:


npm install firebase
Firebase Setup
Create a Firebase Project:

Go to the Firebase Console.
Click on "Add project" and follow the prompts to create a new Firebase project.
Enable Authentication:

In the Firebase Console, navigate to the "Authentication" section.
Click on "Get Started".
Enable the sign-in methods you want (Email/Password, Google, etc.).
Get Firebase Config:

Click on the gear icon next to "Project Overview" and select "Project settings".
Under "Your apps", register your app and copy the Firebase configuration object.
Add Firebase to Your Project:

Create a firebase.js file in your project directory and initialize Firebase:
// firebase.js
import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";

const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_AUTH_DOMAIN",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_STORAGE_BUCKET",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID"
};

const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);