Refresh Token & Jwt Token

preview_player
Показать описание
Refresh Token & Jwt Token (JSON Web Token) information is covered in detailed in this video.
JWT Token stands for JSON Web Token. Jwt token based authentication is one of the most popular authentication mechanisms. Json Web Token token is an encrypted string which is generated using a Key and an encryption algorithm. JWT Access Token and Refresh token helps to provide more security to your application.
-------------------------------------------------------------------------------
What is JWT Token based authentication Web Api work flow? What is the need for Refresh Tokens?
User provides user name and password to the client application. Client application sends the user name and password to the Authorization server. Authorization server validates the credentials and returns JWT Token Web API. Client application preserves the token and sends the JWT Token to the Resource Server. Resource server validates the JWT Token Web API and sends the Resource.
--------------------------------------------------------------------------------
JWT Token Anatomy
JWT Token has 3 parts. First part of the jwt token is called as Header and it will have the algorithm which is used to encrypt the token. Second part of the JWT token is called Payload. It will have all the required information to identify the user. Third part of the JWT token is called as Signature. It will be used to Validate the token. Each JWT token has Validity and once the JWT token is expired, either user has to provide credential again to the JWT Token Based Web API application otherwise can use Refresh tokens.
--------------------------------------------------------------------------------
What are Refresh Tokens in Web API?
Refresh tokens are another type of tokens which can be used to Regenerate the expired JWT Token. Refresh Token can be a GUID or any Encrypted Random number. Refresh Tokens must be preserved in database. Each Refresh token should have exactly one active JWT Token for JWT token based authentication. If a new JWT Token is issued, Previous JWT token must be invalidated.
------------------------------------------------------------------------------
Why cant we use JWT Token with longer life time?
Why JWT tokens are short lived?
How short lived JWT tokens helps the authentication.
Why cant we use JWT tokens instead of Refresh Tokens?
JWT tokens are short lived because to provide additional security. If the token is long lived, If anybody got access to the JWT token can do malicious things. To mitigate that issue JWT tokens must have very short expiration time may be 5 min to 10 min.

Why Refresh tokens are long lived?
---------------------------------------------------------
Refresh tokens should be long lived as they have to be used to regenerate the access tokens.

#TokenBasedAuthentication#
#JWTAuthentication#
#RefreshToken#
00:00 Introduction
00:20 How JWT Token based authentication Work?
03:16 Jwt Token Authentication vs Cookie based Authentication
06:42 What are Refresh Tokens in JWT Authentication
08:25 Need for Refresh Token with Scenarios
Рекомендации по теме
Комментарии
Автор

Thanos really tried to access my Token, BTW very easy to understand. :)

NOMANsOdyssey
Автор

what was the answer to the problem, if user has changed their network and IP address changed ? how will he get the resource access then ?

fired_developer