临时代码提交
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-10-29 18:04:10 +08:00
parent 67667f6438
commit c6c8daaadf
+32 -7
View File
@@ -1,4 +1,5 @@
using Amazon.SecurityToken;
using Amazon.Auth.AccessControlPolicy;
using Amazon.SecurityToken;
using IRaCIS.Application.Contracts;
using IRaCIS.Application.Interfaces;
using IRaCIS.Core.Application.Auth;
@@ -15,6 +16,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -413,16 +415,39 @@ namespace IRaCIS.Api.Controllers
[HttpGet("User/OAuthCallBack")]
public async Task<IResponseOutput> OAuthCallBack(string type, string code)
{
#region AccessToken
#region AccessTo
var headerDic = new Dictionary<string, string>();
headerDic.Add("code", code);
headerDic.Add("grant_type", "authorization_code");
headerDic.Add("redirect_uri", "http://localhost:6100");
headerDic.Add("scope", "all");
//var headerDic = new Dictionary<string, string>();
//headerDic.Add("code", code);
//headerDic.Add("grant_type", "authorization_code");
//headerDic.Add("redirect_uri", "http://localhost:6100");
//headerDic.Add("scope", "all");
#endregion
#region
var client = new RestClient();
var request = new RestRequest("https://logto.test.extimaging.com//oidc/token", Method.Post)
{
RequestFormat = DataFormat.Json
};
////request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
////request.AddParameter("grant_type", "client_credentials");
////request.AddParameter("client_id", clientId);
////request.AddParameter("client_secret", clientSecret);
////request.AddParameter("resource", resource);
////request.AddParameter("scope", scope);
////var response = await client.ExecuteAsync<AuthenticationResponse>(request);
//if (!response.IsSuccessful || response.Data == null)
//{
// throw new InvalidOperationException("Authentication failed.");
//}
#endregion
return ResponseOutput.Ok();
}