An implementation of OpenID Connect Discovery 1.0 for ASP.NET Core
See WebFinger.Server.OidcDiscovery.
var builder = WebApplication.CreateBuilder();
// ...
// e.g. with Keycloak (domain:my-custom-domain.com realm: my-custom-realm)
builder.Services.AddOidcWebFinger(new OidcIssuer(new Uri("https://my-custom-domain.com/realms/my-custom-realm")));
// ...
var app = builder.Build();
// ...
app.UseWebFinger();
// ...
app.Run();
In general the URI must point to the root of the OIDC provider so that client can take advantage of the well known routes. For details see https://openid.net/specs/openid-connect-discovery-1_0.html.