From 71e6099bbd626189bb8f8c879c76922787668642 Mon Sep 17 00:00:00 2001 From: hang <87227557@qq.com> Date: Tue, 29 Oct 2024 23:55:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Controllers/ExtraController.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs index fe14a9a0b..b32bc67ab 100644 --- a/IRaCIS.Core.API/Controllers/ExtraController.cs +++ b/IRaCIS.Core.API/Controllers/ExtraController.cs @@ -444,18 +444,16 @@ namespace IRaCIS.Api.Controllers var opts = new RestClientOptions(baseUrl); using var client = new RestClient(opts); + //https://bump.sh/logto/doc/logto-management-api/authentication var request = new RestRequest("oidc/token", Method.Post); request .AddHeader("Content-Type", "application/x-www-form-urlencoded") .AddParameter("grant_type", "client_credentials") .AddParameter("client_id", appId) .AddParameter("client_secret", appSecret) - .AddParameter("resource", apiAddress); //必须在界面上配置 - - if (scope is not null) - { - request.AddParameter("scope", scope); - } + .AddParameter("resource", apiAddress) //注意这里默认值地址和api 地址有区别 + .AddParameter("scope", scope); + var response = await client.ExecuteAsync(request);