Posts

Showing posts from March, 2021

Adding JWT Authentication with refresh to Angular Project

Image
  In my previous post, I showed how to configure an Asp.Net Core application to use the built-in Identity platform to authenticate via a web page and use JWT for SPA's and mobile clients (See the article  here ).   This tutorial will show you how to add JWT authentication to an angular project using the ASP.NET Core web API backend from my previous tutorial (see LINK). The project will consist of a register page, l ogin page, and a home page that will be protected by a guard and show the token when logged in. If you don't have angular installed on your system, you can run the following command. npm install -g @angular/cli Next, you will want to open a terminal window and execute the following command to create a new project. ng new angular-jwt-auth-demo Change to the new directory, and type the following command to make sure the project is set up and running properly. ng serve You should be able to copy the link provided into a browser and see your project. Now you will want to