-
Notifications
You must be signed in to change notification settings - Fork 840
Open
Labels
Description
We have used RequireAuthorization() to protect our health check API under MapHealthChecks endpoint. The internal call which happens from UI dashboard to get the data is failing as this API is protected. In this case how to get the data from protected health check API by passing the required credentials from UI dashboard.
Sample code:
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapHealthChecks("/api/health", new HealthCheckOptions()
{
Predicate = (check) => true,
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse,
})
.RequireAuthorization();
endpoints.MapHealthChecksUI(opt =>
{
opt.UIPath = "/healthchecks-ui";
})
.RequireAuthorization();
});
.NET Core version: 6
Healthchecks version : 7.0.2
Operative system: Windows