Skip to content

oznakdn/JwtProducer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JwtProducer

Easy jwt implementation

Current Packages

Nuget version Nuget downloads Build & Test Main

HOW TO USE

Copy to appsettings.json and configure the parameters

"JwtOption": {
    "SaveToken": true, // true or false
    "ValidateIssuer": false, // true or false
    "ValidateAudience": false, // true or false
    "ValidateLifetime": true, // true or false
    "Issuer": null, // string
    "Audience": null, // string
    "SigningKey": "You should be write here your security key!" // string
  }

Add to program.cs

builder.Services.AddJwtProducer(builder.Configuration);
app.UseAuthentication();
app.UseAuthorization();

Usage

    [Route("api/[controller]")]
    [ApiController]
    public class AuthController : ControllerBase
    {
        private readonly IJwtBuilder _jwtBuilder;
        public AuthController(IJwtBuilder jwtBuilder)
        {
            _jwtBuilder = jwtBuilder;
        }
    }

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages