Authentication
Explore how to build a secure login and authentication system in Angular by creating a login view, sending user credentials with a POST request, and handling JWT tokens upon successful authentication. Understand how to manage user sessions and prepare for authenticated API requests across your application.
We'll cover the following...
We'll cover the following...
In this lesson, we will perform the following steps to authenticate our application.
- Creating a login view
- Accept user credentials required to authenticate the user
- Send them as a POST request to the server and, if authenticated, you will receive a JWT token in the headers.
- The above will allow the users access to the app.
- Ensure that you send this token for making all your API requests
(The last step will be covered in the next lesson).
Let’s dive right in!
Creating a login view
On the /login route, create a simple modal to show the login view, which will look something like this:
...