fix 使用域名请求

This commit is contained in:
2024-06-21 00:36:10 +08:00
parent c310d6d66b
commit 87d86dc7cf

View File

@@ -28,7 +28,7 @@ public class OAuth2Controller : ControllerBase
{
var authority = _identityServerOption.Value.Authority;
var httpClient = _httpClientFactory.CreateClient("oauth2");
var httpClient = _httpClientFactory.CreateClient();
var content = new StringContent($"grant_type=client_credentials&client_id={request.ClientId}&client_secret={request.ClientSecret}&scope={request.Scope}", Encoding.UTF8, "application/x-www-form-urlencoded");
var response = await httpClient.PostAsync($"{authority}/connect/token", content);