Skip to content

jsacapdev/ac5.custom.jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom validation of a JWT token

/src/CustomJwtApi

Use a requirement based approach.

Add a Requirement by implementing the IAuthorizationRequirement.

This is invoked through a AuthorizationHandler. The AuthorizationHandler can accept some type of additional input. For example, configuration.

Finally, it can be added as a requirement when the middleware is configured in the start-up.

Then decorate the controller to ensure the requirement is fulfilled:

[Authorize(Policy = "Bearer", AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]

Supporting material

Stackoverflow

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages