So in the previous videos, we also discussed about one of the advantages that we have with JWT where
we can send certain information related to a that and when the token is going to expire.
And as you can see, we are sitting here.
What is the expiration time of the token to show you that, how it's going to work and just set a smaller
value, which is a thirty thousand millisecond, which is equivalent to 30 seconds.
So as soon as a token is creator and post 30 seconds, the token will get expired.
So this is the logic that I have written while generating the token and while validating the token.
This method will take care of checking the expiration value.
Also, if there is an exploration issue that's going to throw an exception related to expiration, which
is you can see here expired JWT exception, we can validate that by keeping a breakpoint here.
So I have made the changes now to make it expire within 30 seconds.
Let's try to go to the main class and restart the application.
Meanwhile, I'm also opening the browser and entering the credentials.
The login operation is successful.
Now I keep operating on the operations that we how I'm able to get a response, but as soon as I reach
30 second time my back and will stop at the break point that I have kept.
So now there is no response coming on the back end.
Let's go and see what is happening in the back.
And you can see there is a big point has been stopped with an issue by JWT exception, and it has the
details when the token has been expired.
Due to that, I'm not able to give that response to that friend.
And again, this is a simple scenario.
We can also leverage JWT tokens for many scenarios inside authentication and authorization flow.
Hope this is provided.
Complete details about JWT to you.
If you have any questions, please post inside the Q&A section.
I'll try to answer as soon as possible.
Thank you.
And see you in that next world by.