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

Опубликовано: 27 Июнь 2022
на канале: 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
=====================


Смотрите видео JWT Authentication in DOT NET Core Web API using VS Code | .NET CORE 6.0 Tutorial онлайн без регистрации, длительностью 31 минут 12 секунд в хорошем hd качестве. Это видео добавил пользователь Nihira Techiees 27 Июнь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 8 тысяч раз и оно понравилось 88 людям.