Spring Security

 Spring security is a framework to customize and manage access-control in the application. It has very powerful and scalable Authentication and Authorization process.

There are popular two ways in which we can implement Spring security in the application. 

1. Session - By authentication of the user and managing the session of the user. The session is maintained in the browser and it is carried in all requests. If the user remain inactive for more than 30 minutes (by default) or the time specified in the configuration, the user is logged out. He can aslo logout using the logout option.

2. JWT- Also know as Json Web Token. JWT is powerful and advanced version in security. When user is logging in and the credentials are authenticated, in response we send an Token, JWT. These token consist of Header, payload and signature. Theses token is generated based on SH256 algorithm. So, every time a request from these token os validated. If it's a valid token then request is authorised. If the token is not valid, we give 401 error - Unauthorised. 

Comments

Popular posts from this blog

System Design

Healthy Diet and Lifestyle