Skip to content
Livestream: Demystifying Authentication in ASP.NET Core with Tore Nestenius. Register Now!

BFF Management Endpoints Extensibility

The behavior of each management endpoint is defined in a service. When you add Duende.BFF to the service container, a default implementation for every management endpoint gets registered.

You can add your own implementation by overriding the default after calling AddBff().

The following endpoints are registered in the service container:

// management endpoints
builder.Services.AddTransient<ILoginEndpoint, DefaultLoginEndpoint>();
builder.Services.AddTransient<ISilentLoginEndpoint, DefaultSilentLoginEndpoint>();
builder.Services.AddTransient<ISilentLoginCallbackEndpoint, DefaultSilentLoginCallbackEndpoint>();
builder.Services.AddTransient<ILogoutEndpoint, DefaultLogoutEndpoint>();
builder.Services.AddTransient<IUserEndpoint, DefaultUserEndpoint>();
builder.Services.AddTransient<IBackchannelLogoutEndpoint, DefaultBackchannelLogoutEndpoint>();
builder.Services.AddTransient<IDiagnosticsEndpoint, DefaultDiagnosticsEndpoint>();

The management endpoint services all inherit from the IBffEndpoint, which provides a general-purpose mechanism to add custom logic to the endpoints.

IBffEndpoint.cs
public interface IBffEndpoint
{
Task ProcessRequestAsync(HttpContext context, CancellationToken ct);
}

You can customize the behavior of the endpoints either by implementing the appropriate interface. The default implementations can serve as a starting point for your own implementation.