My first motivation to build this Microservice was to help the Junior Enterprise CITi to automize it's process of development work. For that, I've builded this Node.js application with Expres.js micro-framework to assembly the server, and structured the Core of this Microservice with the jsonwebtoken module of Node.
This applications works following theses next steps:
1- Recive some JWT by the Bearer Token request.
2 - Run the script looking for incompatibilities, like the different secrets used to encrypt the same variable.
3 - And finilly, returns the data of the JWT.
With that, you're abble to construct different ways to work with this response in the frontend. To help you a little bit with theses ways, I created a simple sample to return True if the JWT is valid, or return False wether the JWT is invalid. This sample is in the client folder located in the root of the project.
If you have any feedback or improvements for this Microservice, please contact me and let's talk about it! 🙂
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You will need to have npm or yarn installed on your machine.
To run the project for the first time you must follow this steps:
- Clone the GitHub repository
git clone https://github.com/Giovaniavs/Microservice-JWT-Auth.git
- Install the dependencies
yarn install
or just
yarn
- Add the .env file in the root of the project containing two variables:
PORT=
SECRET=
Obs: Only me have the valid SECRET, if you want to use this microservice, talk to me!
- Run the project! Go to the root of the project and run the command:
yarn start
- Giovani Albuquerque - Full Stack Developer - Giovaniavs
Made by The Giovani Albuquerque