I have a chat bot that I want to be able to create clips but I am having trouble generating a User OAuth token for it.
Currently I am just authorizing the bot by navigating to this page in my web browser.
And copying the code received into this
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
