Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[Route(Constants.ConfigurationRoute)] // Important! This is the OpenID Connect magic.
public class ConfigurationController : ControllerBase
public IActionResult GetConfiguration()
// Ensure token and keys requests use the same cluster as this request
var requestedUrlBase = $"{Request.Scheme}://{Request.Host}/";
var configuration = new OpenIdConnectConfiguration
Issuer = Constants.Issuer,
TokenEndpoint = requestedUrlBase + Constants.TokenRoute,
JwksUri = requestedUrlBase + Constants.KeysRoute,
return Ok(configuration);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment