修改备注
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2024-10-29 23:55:42 +08:00
parent c713d0bc95
commit 71e6099bbd
1 changed files with 4 additions and 6 deletions

View File

@ -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<LogtoTokenResponse>(request);