Testing it up

In order to test up the token refresh feature, we need to (drastically) reduce the access token ExpirationInMinutes that we set in the appsettings.json and appsettings.Development.json files. We can start with a value of 60 for the appsettings.json file--as it will be an appropriate time for production--and a temporary 1 value for the appsettings.Development.json file so that we'll be able to quickly check out whether what we did actually works.

Once done, we can launch the application in debug mode and wait until we see the Home view; from there, it's mandatory that we perform a logout/login before everything else, to ensure that the refresh token will be added to our localStorage. As soon as we do that, we can pick an existing ...

Get ASP.NET Core 2 and Angular 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.