Skip to main content

API Overview

Even if you don't plan to use the Flux API to calculate discounts but doing that using the IDiscountCalculator directly you will want to deploy the API in order to use the Flux UI which requires the API to work.

Authentication

By default Flux doesn't require authentication to talk to the API. That can work if your Flux application isn't public to the internet and you don't care about keeping track of who changed what in Flux.

In most cases you will want to add authentication to the API. You do that by implementing authentication in ASP.NET outside of Flux and then tell Flux to disallow anonymous API access like this:

builder.Services
.AddFlux()
.AddApi(options => options.AllowAnonymousAccess = false)
.Build()
;

You're free to use multiple authentication schemes as you probably want different authentication for your API clients and the Flux UI. The Flux UI doesn't have a login form on it's own so your authentication should redirect to a login page or you can use basic auth.