-
Book Overview & Buying
-
Table Of Contents
ASP.NET Core 2 and Angular 5
By :
In order to handle JWT-based token authentication, we need to properly set up the ASP.NET Core Identity service to ensure that it will handle these tasks:
POST request coming from our clientsHTTP requests by looking at the headers of the request itselfThat said, the first thing to do is define the required steps we need to take care of:
Add and configure the authentication service in the Startup.cs file.
Update the appsettings.json and appsettings.Development.json files to store the required JWT security information (issuer and security key).
Create a TokenController that will accept POST requests carrying the user credentials (username and password), validate them, and generate JWT tokens accordingly.
Create an Angular LoginComponent with a Model-Driven login form to allow our users to perform the login.
Create an Angular AuthService that will handle login/logout and store the JWT...