Skip to content

Session Microservice

Aishwarya Vijay Sinhasane edited this page Feb 4, 2022 · 8 revisions

The session microservice is mostly used to save user authentication tokens. It keeps track of the user's time-out token and replaces it with a new one when it expires.

Working

  • create-session API
  1. This will check if the token already exists if it exists it will check if it's a valid token or not.
  2. If its a valid token then this API will return existed token, otherwise it will generate a new token.
  3. This API will generate access-token for a specific user and store this in the collection session. This is used to keep track of user request logs.
  • logout API
  1. Firstly, this will check if the token is valid or not and this will store it in the session-history collection.
  2. Logout API is used to put current user access tokens into the collection to keep track of expired tokens.
  • refresh API
  1. Once the user login to the system it will assign one access token to that user for a certain amount of time after that this token will get expire.
  2. So this API is used to keep track of that expired tokens and generate new tokens for users and update it into session collection
  • validate API
  1. This API is used to validate user tokens. When the user sends any request it will check token is valid or not. If it's expired it will call refresh API to create a new access token for that user.

Dependencies

  • Spring boot framework
  • MongoDB

Tech

  • Java spring boot framework
  • JWT
  • REST API
  • Database - MongoDB database

Service Port

port - 5004

API

https://documenter.getpostman.com/view/19319161/UVeDuTTk

Clone this wiki locally