Easy to use authentication and authorization api using passportJS.
This project is a simple to use backend starter template that features an authentication and authorization using passportjs strategies. As such, this project can be expanded with other strategies (twitter, google, Oauth) to fit a variety of authentication needs. And for the authorization part, adding or modifying roles can be done by modifing the roles object in /utils/roles.
run npm install to install all the dependencies. (for a complete list of all the dependencies check package.json)
- npm
npm install
- git
git clone [email protected]:HipMaze/Authentication-Api-PassportJS.git
-
before running the code be sure to create a dotenv file with the required environement variables
#Running port of Nodejs API_PORT=3000 #DB URI MONGO_URI= #Base api url BASE_API_URL=/api #Jwt secret key (the best option is to generate a rsa keypair) JWT_SECRET=
-
node
node index.js
if you find any problem using this api, if you find any bug, or if you need help adapting it to your needs be sure to create a new issue i will answer it asap.
- Ayman El Azm : @HipMaze
This project is licensed under the MIT License - see the LICENSE.md file for details
Inspiration, code snippets, etc.