From the course: ASP.NET Core: Token-Based Authentication
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Refreshing expired tokens - ASP.NET Core Tutorial
From the course: ASP.NET Core: Token-Based Authentication
Refreshing expired tokens
- [Instructor] On this part, you'll learn how to generate a new access token using a refresh token. For that, let's go to Visual Studio. In Visual Studio, in the AuthenticationController, we are going to create a new API endpoint. So I'm just going to copy the login-user, then just paste it down here. Replace the login-user with refresh-token, then change the Login with RefreshToken. We're going to also create a new view model. So let us just go to the Solution Explorer. Then inside the ViewModels, right-click, then go to Add. We are going to add a new class. We are going to name this class TokenRequestVM, and I click the Add button. Now, inside here we are going to have two properties. The first property is going to be of type string, and it's going to be the Token, and the second property is going to be the RefreshToken, so RefreshToken. Now, both fields are going to be required. So let us import the namespace for…
Contents
-
-
-
-
(Locked)
Setting up Entity Framework Core8m 44s
-
(Locked)
Adding default identity tables using EF Core8m 51s
-
Configuring token-based authentication9m 38s
-
(Locked)
Adding the authentication controller4m 56s
-
(Locked)
Registering new users using UserManager9m 8s
-
(Locked)
Logging in users4m 54s
-
Generating an access token10m 17s
-
(Locked)
Adding the RefreshToken table5m 4s
-
(Locked)
Generating and storing refresh tokens4m 6s
-
(Locked)
Injecting TokenValidationParameters2m 57s
-
(Locked)
Refreshing expired tokens12m 6s
-
(Locked)
-
-