-
-
Save chriskuech/b95afc3c51b02d4b2f131e61f7bb0956 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Route(Constants.ConfigurationRoute)] // Important! This is the OpenID Connect magic. | |
[Consumes("application/json")] | |
[Produces("application/json")] | |
[ApiController] | |
public class ConfigurationController : ControllerBase | |
{ | |
[HttpGet] | |
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