DFS Auth Service is a centralized, secure authentication service for all DFS projects, ensuring seamless access and enhanced security
You can visit the following pages to read the documentation of the APIs
To install DFS-Auth, follow these steps:
git clone [email protected]:shaantanu314/DFS_Auth-Service.git
Install all the npm packages
npm i
Create a .env
and copy the content of .env.example
cp .env.example .env
Setup mailing creds for nodemailer
. We use google OAuth2 credentials to authorize the nodemailer client to send mails on behalf of us.
Visit the youtube video linked below to setup your google account to generate these four keys which will be added in .env
GOOGLE_USER_EMAIL = "[email protected]"
GOOGLE_CLIENT_ID = "XXXX"
GOOGLE_CLIENT_SECRET = "XXXX"
GOOGLE_REFRESH_TOKEN = "XXXX"
Database and User creation
# Login to your `sql` cli using sudo account
mysql -u root -p
# Create a database for this project
CREATE DATABASE DFSAuth;
# You can create a database of any name but make sure the user and database name are properly set in .env
# Create a user specific for this project and grant all permissions on this newly created database
CREATE USER 'dfs-auth'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON DFSAuth.* TO 'dfs-auth'@'localhost';
Setup Tables
Copy the contents of src/db/setup.sql
and paste it in the mysql
cli.
Inside root of your repository
mkdir keys
# Generate Private Key
ssh-keygen -t rsa -b 2048 -m PEM -f keys/rsa.key
# Generate the Public Key
openssl rsa -in keys/rsa.key -pubout -outform PEM -out keys/rsa.key.pub
npm start
-
Install Insomnia on your PC by following the instructions here.
-
Import the collection in your insomnia panel from
testingAPI.insomnia.json
.