public static void Main(string[] args) {
string id = "8be7hguk2ntew88z3s2cn3ze98vc2x";
string secret = "secret";
string code = "code";
HttpClient client = new HttpClient();
var responsetask = client.PostAsync(
"https://id.twitch.tv/oauth2/token?client_id="+id+"&client_secret="+secret+"&code="+code+"&grant_type=authorization_code&redirect_uri=http://localhost", new StringContent(""));
responsetask.Wait();
var response_string = responsetask.Result.Content.ReadAsStringAsync();
response_string.Wait();
Console.WriteLine(response_string.Result);
File.WriteAllText("C:/Users/User/Desktop/Output.txt", response_string.Result);
client.Dispose();
Console.ReadKey();
}
But I keep receiving this error code {“status”:400,“message”:“Invalid authorization code”}
If anyone knows why this is happening or has another less stupid way I can get the code locally I would appreciate it
This is implicit auth you don’t need the second step
| response_type | auth type | refresh | step two? | You are Using
|—|—|—|—|—|—|
| token | implicit auth | can’t | no second step | Yes
| code | “normal” auth | can | needs second step | No
Okay but I am trying to get a code that can refresh and I’m doing so by continuing to the second step in that program am I not? I feel like im fundamentally misunderstanding something here.