Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

freeCodeCamp

ASP.NET Web API - Token Based Authentication Tutorial

via freeCodeCamp

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to implement secure token-based authentication in ASP.NET Web API applications through this comprehensive 2-hour tutorial. Explore the fundamental differences between authentication and authorization, comparing traditional cookie-based methods with modern token-based approaches. Discover how tokens and refresh tokens function together to provide enhanced security through shorter expiration times and understand the complete process of generating new tokens. Master the implementation of Identity tables using Entity Framework Core, configure authentication settings in Startup.cs, and build a complete authentication controller. Practice registering new users, generating both access and refresh tokens, handling user login processes, and implementing token refresh mechanisms. Advance to role-based authentication to control user permissions and access levels within your applications. Follow along with provided starter and final code repositories to build a fully functional authentication system that ensures secure data access in web applications.

Syllabus

- 0:00:00 Introduction
- 0:02:07 Authentication vs Authorization
- 0:04:34 Traditional vs Token-based Authentication
- 0:14:10 Adding Identity tables with EFCore
- 0:21:55 Configuring Authentication in Startup.cs
- 0:33:07 Setting up Authentication Controller
- 0:37:54 Registering a new user
- 0:47:36 Generating an access and a refresh token
- 1:02:38 Logging in an existing user
- 1:14:10 Get access token using the refresh token
- 1:41:41 Adding role based authentication
- 2:02:55 Thank you

Taught by

freeCodeCamp.org

Reviews

Start your review of ASP.NET Web API - Token Based Authentication Tutorial

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.