To add authentication into your ASP.Net app, check the Startup
class => ConfigureServices
method.
Look for services.AddAuthentication
.
This will tell you app how to validate a token.
You have to enable token validation per route/controller separately. (Below in this readme file. In "Securing your API" section)
To generate documentation about your authentication setup, check Startup
class => ConfigureServices
method
Look for services.AddSwaggerGen
.
To create a token, check IdentityController
and JwtIssuer
classes.
To add token validation to your controllers and routes, check GreetingsController
class.
Use attribute Authorize
on the whole controller or individual routes.
To add claims to your token check JwtIssuer
class.
To get those claims from the token check GreetingsController
class => GreetByName
method.