Then, which is the oauth token that I need? The data that I’m requesting is from my channel.
I tried with the following
$.ajax({
type: 'GET',
url: 'https://api.twitch.tv/kraken/oauth2/authorize?response_type=token&client_id=MY-CLIENT-ID&redirect_uri=http://localhost&scope=channel_subscriptions&state=testest',
headers: {
'Client-ID': 'MY-CLIENT-ID'
},
success: function(data) {
console.log(data);
}
});
but I have the following error in Chrome console
XMLHttpRequest cannot load https://api.twitch.tv/kraken/oauth2/authorize?response_type=token&client_id=...&redirect_uri=http://localhost&scope=channel_subscriptions&state=testest. Redirect from ‘https://api.twitch.tv/kraken/oauth2/authorize?response_type=token&client_id=...&redirect_uri=http://localhost&scope=channel_subscriptions&state=testest’ to ‘https://api.twitch.tv/kraken/oauth2/authenticate?action=authorize&client_id…%2Flocalhost&response_type=token&scope=channel_subscriptions&state=testest’ has been blocked by CORS policy: Request requires preflight, which is disallowed to follow cross-origin redirect.
I don’t want to instance a server for this simple task ![]()