JWT Authentication & Authorization on a C# .NET Web API

Опубликовано: 02 Июнь 2026
на канале: Keep it simple, stupid.
748
18

How I implement JSON Web Token Bearer authentication and authorization in my .NET 6 WEB API project. Plus, how to keep a user signed in, refreshing the access token.

(Free) You can find the source code here: https://www.patreon.com/posts/net-ful...

If you found this video helpful, like & subscribe, that means a lot to me!
And you may buy me a coffee: https://www.buymeacoffee.com/kis.stupid

0:00 Intro
0:11 Refactor
01:21 Confirm UserProfile
01:39 Add user role
04:24 Login
12:45 Generate auth response
21:25 Create JWT
37:10 Create RefreshToken
43:38 Test login in Swagger
49:08 Inspect JWT
51:44 Add role to JWT
54:50 Setup authorization
01:02:50 Swagger JWT support
01:36:43 Better exception handling
01:43:48 Refresh tokens
02:05:35 Extra AuthService methods
02:23:25 Extra AuthController methods
02:25:54 CurrentUserService
02:37:35 DateTimeService

#csharp #dotnet #entityframework #identityframework #mssqlserver #mssql #cleanarchitecture #authentication #api #development #local #web #fullstack #webdevelopment #authorization #jwt #bearer