Skip to content

Easy to use Authentication and Authorization api / backend starter

License

Notifications You must be signed in to change notification settings

HipMaze/Authentication-Api-PassportJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Authentication-Api-PassportJS

Easy to use authentication and authorization api using passportJS.

Description

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.

Getting Started

Dependencies

run npm install to install all the dependencies. (for a complete list of all the dependencies check package.json)

  • npm
    npm install

Installing

  • git
    git clone git@github.com:HipMaze/Authentication-Api-PassportJS.git

Executing program

  • 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

Help

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.

Authors

License

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

Acknowledgments

Inspiration, code snippets, etc.

Releases

No releases published

Packages

No packages published