Skip to content

andrii-khomutovskyi-qb/quickblox-firebase-auth-server

Repository files navigation

QuickBlox Firebase Auth Server

QuickBlox Firebase Auth Server is designed for secure storage of API keys using dotenv. This server allows you to create a QuickBlox user session using Firebase Authentication with Phone Numbers.

Prerequisites

  • Node.js (v16 and above)
  • npm (v8 and above)

Installation

Install dependencies:

npm install

Configurations

Set up environment variables:

  1. Rename the .env.example file to .env.
  2. Edit the .env file and replace the placeholder values with your actual configuration.

Usage

To start the server, run the following command:

npm start

The server will be started on the specified port (or default port 3000 if not provided).

Create QuickBlox session

Create QuickBlox session with phone

To create a QuickBlox user session, submit a POST request to the /session/phone endpoint with the access_token received from Firebase.

curl --request POST \
  --url http://localhost:3000/session/phone \
  --header 'Content-Type: application/json' \
  --data '{
	"access_token": "<FIREBASE_TOKEN_ID>"
}'

Create QuickBlox session with email

To create a QuickBlox user session, submit a POST request to the /session/email endpoint with user email and password.

curl --request POST \
  --url http://localhost:3000/session/email \
  --header 'Content-Type: application/json' \
  --data '{
	"email": "<USER_EMAIL>",
	"password": "<USER_PASSWORD>"
}'

Create QuickBlox session with login

To create a QuickBlox user session, submit a POST request to the /session/login endpoint with user login and password.

curl --request POST \
  --url http://localhost:3000/session/email \
  --header 'Content-Type: application/json' \
  --data '{
	"login": "<USER_EMAIL>",
	"password": "<USER_PASSWORD>"
}'

QuickBlox

QuickBlox Firebase Auth Server required integration with QuickBlox to establish a secure access mechanism for the Open AI API and Firebase authorization. By incorporating QuickBlox, a double authentication process is implemented to guarantee that only authorized users can gain access to the API. This involves verifying the registration and authorization of the user attempting to access the API, effectively thwarting any unauthorized third-party interference and safeguarding the API against potential attackers.

To integrate QuickBlox into the QuickBlox Firebase Auth Server, follow these steps:

  1. Register and set up your QuickBlox account by following the instructions provided in the QuickBlox documentation.

  2. Obtain your QuickBlox API URL and ensure that these it is correctly configured in the .env file.

Contributing

Contributions are welcome! If you find any issues or want to add new features, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published