Skip to content

Authentication Providers

JWT Authentication

Configure JWT authentication with custom options:

builder.Services.AddMokaAuth(options => {
options.UseJwtAuthentication(jwt => {
jwt.SecretKey = "your-secret-key";
jwt.Issuer = "your-issuer";
jwt.Audience = "your-audience";
});
});

Enable cookie-based authentication:

builder.Services.AddMokaAuth(options => {
options.UseCookieAuthentication();
});