From the course: Building Angular and ASP.NET Web API Apps
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Implement the auth interceptor
From the course: Building Angular and ASP.NET Web API Apps
Implement the auth interceptor
- [Presenter] Right now, if anyone finds out about our API endpoints, they can just use them without being authenticated. So, for example, if I just go to transactions, then try it out and then execute, you're going to see that we get a 200 response code and also some data. Now, we did add authentication protection on the front-end side where we check, for example, if the user is logged in or not, we have also added auth guards, but we don't have any security checks on the backend side, and that is what we're going to do in this part. If we just close the browser and then go to the transactions controller, and then down here add authorized attribute, what this means is that all the users that want to access any API endpoints within this controller need to be authenticated, and the authentication of the user has already been configured in the program.cs, but we have not used it so far. We have just created the JWT, which we return to the frontend app and we stored it in the local…
Contents
-
-
-
-
-
-
Understanding token-based authentication3m 2s
-
(Locked)
Configure token-based authentication in ASP.NET Web API5m 49s
-
(Locked)
Build the register API endpoint11m 29s
-
(Locked)
Create the login API endpoint9m 47s
-
(Locked)
Develop the authentication service in angular8m 7s
-
(Locked)
Register for a new account15m 38s
-
(Locked)
Add data validation to a registered form11m 28s
-
(Locked)
Log in to an account6m 6s
-
(Locked)
Secure routes with Angular Guards5m 54s
-
(Locked)
Update the header for logout functionality6m 53s
-
(Locked)
Implement the auth interceptor7m 21s
-
(Locked)
Set a user ID when a transaction is created and loaded8m 28s
-
-
-