About AccessToken And RefreshToken
When building a secure web application, it's important to handle user authentication efficiently. Two key components that help with this are Access Tokens and Refresh Tokens.
Access Tokens : Short live and Emergency Use
An Access Token is temporary credential issued to users after they successfully log in. It allows users to access protected resourcses without having to repeatedly enter their username and password
Typically It is valid for a short time - 15 min - 20 min (max to max 1 day)
Refresh Tokens / session Storage: long live and future uses
Refresh Token components the access token and is usually stored in a more secure location, like the server's database or secure session storage. It has a longer life span and is used to issue a new Access Token once the old one expire
Basically it uses if the user a long time not doing any work and then they wants to work on that but it will not doing any work- That's the reason the work is doing by the refresh Token and the token is help to regenrate the token by the end point hit (it will all doint by the frontend developer)
- Pupose:- These tokens are used to authenticate user requests while keeping their password secure.