Hello, I need authorization via twitch api.
I am using:
https://api.twitch.tv/kraken/oauth2/authorize ?response_type=token &client_id=[your client ID] &redirect_uri=[your registered redirect URI] &scope=[space separated list of scopes]
This is the code:
$ku_twhitch = curl_init();
$query = “response_type=token&client_id=”.CLIENT_ID.“&redirect_uri=”.REDIRECT_URI.“&scope=”.SCOPE;
curl_setopt($ku_twhitch,CURLOPT_URL,URL_TWITCH_AUTCH.“?”.$query);
curl_setopt($ku_twhitch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ku_twhitch,CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ku_twhitch,CURLOPT_RETURNTRANSFER,TRUE);
$result = curl_exec($ku_twhitch);
curl_close($ku_twhitch);
print_r($result);
Can’t get the token, after running, I get redirect to REDIRECT_URI and blank page.
Tell me, how I can the token vie curl method?