JWT Authentication in DOT NET Core Web API using VS Code | .NET CORE 6.0 Tutorial

Published: 27 June 2022
on channel: Nihira Techiees
8k
88



This video explains how to implement JWT Authentication in DOT NET Core Web API using VS Code

Steps followed
============
1, Enable Authentication adding “useAuthentication”
2, Create Method for generate token
3, Register the security key in the appsettings
4, Access and inject the key into the controller
5, Validate user credentials based on input request

Create Token
============
1, Initiate handler using class “JwtSecurityTokenHandler”
2, Create token using CreateToken method it expects input as token descriptor
3, Initiate token descriptors here just define Subjects, Expire time, Signing Credentials
4, Finally write & return the token

Validate Token
============
1, Enable JWT Authentication using AddAuthentication & add values for DefaultAuthenticationScheme ,Challenging scheme
2, Then Add “AddJwtBearer” here set values for Require https metadata , SaveTokens & Validations parameters
3, Token validation parameter expects below values

Source Code GitHub Link
====================


Link for Web API using VS Code
==========================


Link for Base 64 Encode
=====================


JWT Token Extraction Link
=====================


Watch video JWT Authentication in DOT NET Core Web API using VS Code | .NET CORE 6.0 Tutorial online without registration, duration 31 minute 12 second in high hd quality. This video was added by user Nihira Techiees 27 June 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 8 thousand once and liked it 88 people.