Installation
Install Moka.Auth using the .NET CLI:
dotnet add package Moka.AuthOr using the Package Manager Console:
Install-Package Moka.AuthBasic Setup
- Add the following to your
appsettings.json:
{ "Authentication": { "EnableJWT": true, "EnableCookie": false, "EnableOpenID": false, "EnableApiKey": false }, "Jwt": { "Key": "your-secure-key-here", "Issuer": "your-issuer", "Audience": "your-audience", "ExpirationMinutes": 30 }}- Configure services in
Program.cs:
builder.Services.AddMokaAuth();Or with custom configuration:
builder.Services.AddMokaAuth(options => { options.EnableJWT = true; options.JwtOptions = new JwtOptions { Key = "your-secure-key-here", Issuer = "your-issuer", Audience = "your-audience", ExpirationMinutes = 30 };});Next Steps
After installation, check out our Quick Start guide to learn how to implement authentication in your application.