2021-11-13 03:21:59 +00:00
|
|
|
using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
2021-11-22 22:57:51 +00:00
|
|
|
namespace Start.Server.Controllers {
|
|
|
|
public class OidcConfigurationController : Controller {
|
|
|
|
private readonly ILogger<OidcConfigurationController> _logger;
|
2021-11-13 03:21:59 +00:00
|
|
|
|
2021-11-22 22:57:51 +00:00
|
|
|
public OidcConfigurationController(
|
|
|
|
IClientRequestParametersProvider clientRequestParametersProvider,
|
|
|
|
ILogger<OidcConfigurationController> logger) {
|
|
|
|
ClientRequestParametersProvider = clientRequestParametersProvider;
|
|
|
|
_logger = logger;
|
|
|
|
}
|
2021-11-13 03:21:59 +00:00
|
|
|
|
2021-11-22 22:57:51 +00:00
|
|
|
public IClientRequestParametersProvider ClientRequestParametersProvider { get; }
|
2021-11-13 03:21:59 +00:00
|
|
|
|
2021-11-22 22:57:51 +00:00
|
|
|
[HttpGet("_configuration/{clientId}")]
|
|
|
|
public IActionResult GetClientRequestParameters([FromRoute] string clientId) {
|
|
|
|
var parameters = ClientRequestParametersProvider.GetClientParameters(HttpContext, clientId);
|
|
|
|
return Ok(parameters);
|
|
|
|
}
|
|
|
|
}
|
2021-11-13 03:21:59 +00:00
|
|
|
}
|