1
00:00:00,180 --> 00:00:05,910
So in the previous videos, we also discussed about one of the advantages that we have with JWT where

2
00:00:05,910 --> 00:00:12,360
we can send certain information related to a that and when the token is going to expire.

3
00:00:12,630 --> 00:00:15,150
And as you can see, we are sitting here.

4
00:00:15,150 --> 00:00:22,320
What is the expiration time of the token to show you that, how it's going to work and just set a smaller

5
00:00:22,320 --> 00:00:27,310
value, which is a thirty thousand millisecond, which is equivalent to 30 seconds.

6
00:00:27,330 --> 00:00:33,850
So as soon as a token is creator and post 30 seconds, the token will get expired.

7
00:00:33,930 --> 00:00:39,930
So this is the logic that I have written while generating the token and while validating the token.

8
00:00:39,930 --> 00:00:43,640
This method will take care of checking the expiration value.

9
00:00:43,650 --> 00:00:51,870
Also, if there is an exploration issue that's going to throw an exception related to expiration, which

10
00:00:51,870 --> 00:00:59,410
is you can see here expired JWT exception, we can validate that by keeping a breakpoint here.

11
00:00:59,970 --> 00:01:03,930
So I have made the changes now to make it expire within 30 seconds.

12
00:01:04,260 --> 00:01:08,460
Let's try to go to the main class and restart the application.

13
00:01:08,820 --> 00:01:13,680
Meanwhile, I'm also opening the browser and entering the credentials.

14
00:01:14,040 --> 00:01:15,990
The login operation is successful.

15
00:01:16,410 --> 00:01:25,440
Now I keep operating on the operations that we how I'm able to get a response, but as soon as I reach

16
00:01:25,800 --> 00:01:31,170
30 second time my back and will stop at the break point that I have kept.

17
00:01:31,350 --> 00:01:34,300
So now there is no response coming on the back end.

18
00:01:34,320 --> 00:01:37,050
Let's go and see what is happening in the back.

19
00:01:37,050 --> 00:01:44,520
And you can see there is a big point has been stopped with an issue by JWT exception, and it has the

20
00:01:44,520 --> 00:01:47,760
details when the token has been expired.

21
00:01:47,970 --> 00:01:51,880
Due to that, I'm not able to give that response to that friend.

22
00:01:52,010 --> 00:01:54,320
And again, this is a simple scenario.

23
00:01:54,540 --> 00:02:03,100
We can also leverage JWT tokens for many scenarios inside authentication and authorization flow.

24
00:02:03,270 --> 00:02:04,980
Hope this is provided.

25
00:02:05,130 --> 00:02:08,090
Complete details about JWT to you.

26
00:02:08,310 --> 00:02:12,660
If you have any questions, please post inside the Q&A section.

27
00:02:12,930 --> 00:02:15,660
I'll try to answer as soon as possible.

28
00:02:15,690 --> 00:02:16,200
Thank you.

29
00:02:16,200 --> 00:02:17,910
And see you in that next world by.

