我正在尝试使用.net 核心中的 EvE online 的 SSO 系统通过 Oauth2 设置登录,并且在 Post 请求阶段发现它是不可能的。这就是我过去使用标准 .net 的方式。有人能帮我转换一下吗?
byte[] encodedKey = Encoding.UTF8.GetBytes(clientId + ":" + clientSecret);
//
HttpWebRequest request = HttpRequestHelper.CreateRequest(new Uri("https://login.eveonline.com/oauth/token"));
request.Host = Host;
request.Headers.Add("Authorization", "Basic " + encodedKey);
request.Method = "POST";
HttpRequestHelper.AddPostData(request, "grant_type=authorization_code&code=" + code);
string response = await requestAsync(request).ConfigureAwait(false);
var result = JsonConvert.DeserializeObject<AuthResponse>(response);
return result;
ps这是我正在寻找的帖子请求格式
POST https://login.eveonline.com/oauth/token HTTP/1.1
Authorization: Basic bG9...ZXQ=
Content-Type: application/x-www-form-urlencoded
Host: login.eveonline.com
grant_type=authorization_code&code=gEyuYF_rf...ofM0