Hey guys,
I am stuck here. This should work, but I get a http 400 instead of a token. I really ould like to work through this and understand the mechanics myslef instead of using a library. Do i do anything wrong here? See code:
private void GetToken(String codeStr)
{
WebClient request = new WebClient();
string auth_header = $"{clientID}:{secretKey}";
string auth_header_64 = $"Basic {Convert.ToBase64String(Encoding.UTF8.GetBytes(auth_header))}";
request.Headers[HttpRequestHeader.Authorization] = auth_header_64;
var post_params = new NameValueCollection();
post_params.Add("grant_type", "authorization_code");
post_params.Add("code", codeStr);
byte[] response = request.UploadValues($"https://login.eveonline.com/oauth/token", "POST", post_params);
string actual_response = Encoding.UTF8.GetString(response);
MessageBox.Show(actual_response);
}