Skip to content

Secure Firebase Authentication API built with Node.js & Express. Supports JWT-based auth, multiple providers (Google, Apple, Microsoft, Facebook), and easy integration.

License

Notifications You must be signed in to change notification settings

agentnovax/agentnovax-api-auth-nodejs-firebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentNovaX Banner


AgentNovaX

Welcome to AgentNovaX! 🌍✨

At AgentNovaX, our vision is to create a world where innovation, collaboration, technology, and sustainability work hand-in-hand to empower communities. We aim to provide tools that simplify tasks, increase productivity, and contribute to a better planet. Through creativity, inclusivity, and environmental consciousness, we strive to inspire a global movement toward shared success and continuous growth. 🌱💡


Firebase Auth Node.js API 🚀

This project provides a simple Node.js API for validating Firebase ID Tokens.


Features 🔑

  • User registration with Firebase Authentication 🔐
  • Validates ID tokens using Firebase Admin APIs
  • Supports multiple authentication providers (Google, Microsoft, Apple, Facebook) 🌐
  • Returns Email and UID for the application 🔑

Requirements ⚙️

  • Node.js 16+
  • Firebase service account JSON file
  • Docker (optional for containerized deployment)

Setup 🛠️

  1. Clone the project:
git clone <repo-url>
cd agentnovax-api-auth-nodejs-firebase
  1. Install dependencies:
npm install
  1. Set up environment variables:
  • Replace {} in the .env file with your Firebase service account JSON.
  1. Run the application:
npm start

Docker Setup 🏗️

  1. Build the Docker image:
docker build -t agentnovax-api-auth-nodejs-firebase .
  1. Run the Docker container:
docker run -p 3000:3000 agentnovax-api-auth-nodejs-firebase

GitHub Workflow 🚀

The workflow is set to trigger on push and pull requests to the main branch.


API Usage 📡

POST /validate

  • Headers: Authorization: <Firebase ID Token>

API Testing with Postman 🛠️

This project comes with a Postman collection inside assets/postman to easily test the API endpoints. You can import the agentnovax-api-auth-nodejs-firebase along with agentnovax-api-auth-nodejs-firebase-IN_local into your Postman application to start testing the authentication flows.

How to Use the Postman Collection

  1. Download the Postman Collection:
    Download the agentnovax-api-auth-nodejs-firebase from the repository.

  2. Import into Postman:
    Open Postman and click on the "Import" button on the top left. Select the downloaded collection file and import it into Postman.

  3. Set Up Environment:
    Collection includes an environment file agentnovax-api-auth-nodejs-firebase-IN_local, import it into Postman to configure variables such as HOST, CONTEXT and DOMAIN. This will allow you to test the endpoints efficiently.

  4. Test API Endpoints:
    Once imported, you can start testing the login endpoint provided by the API. Make sure to provide the correct email and password in the pre-request script for login.

This collection simplifies testing the API without needing to manually craft requests and responses.


Adding Authentication Providers 🌍

Google Authentication

  • Go to Firebase Console > Authentication > Sign-in Method.
  • Enable Google and provide the OAuth 2.0 client ID.

Microsoft Authentication

  • Enable Microsoft in Firebase Console and provide OAuth credentials from Azure Portal.

Apple Authentication

  • Set up Apple authentication with the credentials from your Apple Developer account.

Facebook Authentication

  • Enable Facebook authentication and provide the credentials from Facebook Developer Console.

Contributions ✨

We welcome contributions! Feel free to open a pull request or raise an issue for enhancements or bug fixes.


Additional Notes 📋

  • Testing: Use tools like Postman or cURL to test API endpoints.
  • Scaling: Consider containerization with Docker for consistent deployment across environments.
  • Providers: Refer to the Firebase documentation for detailed setup for other authentication providers.
  • For more information, check out the NodeJS Documentation and Firebase Authentication Docs.

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.


Contact 📧

For any queries, feel free to reach out via agentnovaxp@gmail.com.


Follow AgentNovaX 🌍

Stay connected with AgentNovaX through our social media channels:


NovaLeaf Concept 🌱

NovaLeaf is an initiative focused on environmental sustainability, aiming to contribute to a greener planet. Through this initiative, AgentNovaX is committed to planting trees, fostering green projects, and encouraging eco-friendly practices among individuals and communities.

  • Plant a Tree, Empower a Community: For every milestone achieved in our platform, a tree will be planted in a designated area.
  • Green Nova Trees: These trees represent our growth and commitment to sustainability, and each one is named for the cause it supports.
  • Join the Movement: Become part of the NovaLeaf family and help us plant the future, one tree at a time. 🌳

🌟 Please consider starring this repository to support the NovaLeaf initiative 🌟

For more information, visit NovaLeaf.


DataFlux 🔄

DataFlux provides free tools for data conversion, JSON/YAML beautification, and validation to help developers and data enthusiasts streamline their workflow.

  • Tools available: JSON/YAML Beautifiers and Validators, JSON/YAML conversion, Text Compare, JavaScript Validators, and more.
  • Visit DataFlux to explore our tools and enhance your productivity.

About

Secure Firebase Authentication API built with Node.js & Express. Supports JWT-based auth, multiple providers (Google, Apple, Microsoft, Facebook), and easy integration.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published