临时代码提交
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
67667f6438
commit
c6c8daaadf
|
@ -1,4 +1,5 @@
|
||||||
using Amazon.SecurityToken;
|
using Amazon.Auth.AccessControlPolicy;
|
||||||
|
using Amazon.SecurityToken;
|
||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Application.Interfaces;
|
using IRaCIS.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.Auth;
|
using IRaCIS.Core.Application.Auth;
|
||||||
|
@ -15,6 +16,7 @@ using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using RestSharp;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -413,16 +415,39 @@ namespace IRaCIS.Api.Controllers
|
||||||
[HttpGet("User/OAuthCallBack")]
|
[HttpGet("User/OAuthCallBack")]
|
||||||
public async Task<IResponseOutput> OAuthCallBack(string type, string code)
|
public async Task<IResponseOutput> OAuthCallBack(string type, string code)
|
||||||
{
|
{
|
||||||
#region 获取AccessToken
|
#region 获取AccessTo
|
||||||
|
|
||||||
var headerDic = new Dictionary<string, string>();
|
//var headerDic = new Dictionary<string, string>();
|
||||||
headerDic.Add("code", code);
|
//headerDic.Add("code", code);
|
||||||
headerDic.Add("grant_type", "authorization_code");
|
//headerDic.Add("grant_type", "authorization_code");
|
||||||
headerDic.Add("redirect_uri", "http://localhost:6100");
|
//headerDic.Add("redirect_uri", "http://localhost:6100");
|
||||||
headerDic.Add("scope", "all");
|
//headerDic.Add("scope", "all");
|
||||||
|
|
||||||
#endregion
|
#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();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue