Hello!
Step by step:
To do a login:
I open this URL in my webBrowser:
string _url = "https://id.twitch.tv/oauth2/authorize?client_id=___MY_CLIENT_ID___&redirect_uri=http://localhost:8000&response_type=token&scope=channel_read+user:edit+channel_stream";
After this I get the access token. Using the access token I can do some request to API. Works correctly
The next step is do logoff of the user. I use:
string url = "https://id.twitch.tv/oauth2/revoke?client_id=__MY_CLIENT_ID__&token=" + tokenTwitch;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.KeepAlive = false;
request.ProtocolVersion = HttpVersion.Version11;
request.Headers.Add("Authorization:OAuth " + tokenTwitch);
request.Headers.Add("client_id: __MY_CLIENT_ID__");
request.Method = "POST";
request.Timeout = 2000;
request.ContentType = "application/json; charset=UTF-8";
//request.Accept = "application/json";
request.Accept = "application/vnd.twitchtv.v5+json";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
After did this request I have code result = 200. (OK)
How I can to ask ‘login and password’ to use again when I call:
string _url = “https://id.twitch.tv/oauth2/authorize?client_id=MY_CLIENT_ID&redirect_uri=http://localhost:8000&response_type=token&scope=channel_read+user:edit+channel_stream”;
I need to do logoff of the user.