Apply JWT Access Tokens and Refresh Tokens in ASP .NET Core Web API 6
Aram Tchekrekjian
Microsoft MVP | Daily tips to get better in .NET and C# | codingsonata.com | Technical Product Head at Aramex
This is an excerpt for the tutorial found in codingsonata.com, you can find the link for the full tutorial here:
In this tutorial you will learn how to build and secure RESTful APIs using ASP.NET Core Web API in .NET 6 and JWT Authentication.
The API project will connect to SQL Server Express Database using Entity Framework Core 6. You will learn how to generate secure JWT-based access tokens using the AspNetCore JwtBearer Authentication nuget package.
Refresh tokens are a great way to complete the access tokens functionality, by allowing the users to silently refresh the access tokens whenever they expire using the refresh tokens, so their experience would be seamless with your site or your app.
Along the way, you will see how you can create refresh tokens, validate them and persist them on the database. So whenever a user decides to logout, we can remove the refresh token from the database.
At the end of the tutorial, you will be able to test your whole work using Postman.
So, are you ready to start your learning journey in applying JWT Access Tokens and Refresh Tokens in your RESTful APIs and your app?
If you think this tutorial is helpful, please feel free to like and share.
Let me know your comments.