Closed panthernet closed 1 year ago
Still have that problem. Seems like every SSO related request in the lib fails. Meanwhile if I replace request code in GetToken method with this - it works.
using (var ssoClient = new HttpClient())
{
ssoClient.DefaultRequestHeaders.Add("User-Agent", "BELLA");
var values = new Dictionary<string, string> { { "grant_type", "authorization_code" }, { "code", $"{code}" } };
ssoClient.DefaultRequestHeaders.Add("Authorization", $"Basic {_clientKey}");
var content = new FormUrlEncodedContent(values);
using (var tokenresponse = await ssoClient.PostAsync("https://login.eveonline.com/v2/oauth/token", content))
{
var responseString = await tokenresponse.Content.ReadAsStringAsync();
var token = JsonConvert.DeserializeObject<SsoToken>(responseString);
return token;
}
}
You have no need to add the headers for user agent or authorization yourself.
First step is to setup your app according to the README file. There is an EsiConfig
object that needs to be setup properly for this to work.
You have no need to add the headers for user agent or authorization yourself. First step is to setup your app according to the README file. There is an
EsiConfig
object that needs to be setup properly for this to work.
I have it done ofcause. Still I have the same result. I had to clone the source code and change the request code for the one shown above to make it work. It is a code from my older project. Strangely your lib doesn't work for me out of the box.
Btw it returns code 200 and I use all the data from your config. Hmmm except user agent maybe.
I wonder what might cause this behavior? Because changing the request code makes it work.
@seraphx2 These two lines cause described behavior for SSO. Once I comment them all work as intended. At least for SSO. Haven't probed other methods as I want to deal with auth first.
So I guess you need a separate HttpClient with corrected settings to work with login.eveonline.com It's been a while since I played with EVE API so I might miss the point in my conclusion. Cheers.
Nope. These two baddies also spoils corporation requests to API for me, hm.
Can you join the Discord channel to talk about this further? It is easier than going back and forth here.
Hi, currently I'm getting this error. I suppose the request should return a JSON but looks like I'm getting some binary rubbish.
Here're the code scaps: