Skip to content

BFF Silent Login Endpoint Extensibility

The BFF silent login endpoint can be customized by implementing the ISilentLoginEndpoint.

You can customize the behavior of the silent login endpoint by implementing the ProcessRequestAsync method of the ISilentLoginEndpoint interface. The default implementation can serve as a starting point for your own implementation.

If you want to extend the default behavior of the silent login endpoint, you can instead add a custom endpoint and call the original endpoint implementation:

Program.cs
var bffOptions = app.Services.GetRequiredService<IOptions<BffOptions>>().Value;
app.MapGet(bffOptions.SilentLoginPath, async (HttpContext context, CancellationToken ct) =>
{
// Custom logic before calling the original endpoint implementation
var endpointProcessor = context.RequestServices.GetRequiredService<ISilentLoginEndpoint>();
await endpointProcessor.ProcessRequestAsync(context, ct);
// Custom logic after calling the original endpoint implementation
});