Implementing the login functionality and generating a JWT

The GiveNTake application allows anonymous users to access and use some of the APIs, such as product search and product display. But other operations, such as sending and reading messages, are only allowed to registered users, which means that users will have to go through an authentication phase where the application will validate their credentials, such as their username and password, and give them the access token in the form of a JWT. Afterwards, the token will be validated with each request and the user details will be extracted. 

Adding login functionality to the GiveNTake application is done like this: 

  1. First, let's define the user login input, that is, their email and password, ...

Get Hands-On Full-Stack Web Development with ASP.NET Core 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.