Hello,
I’m building an app to manage streamers clips (list, delete one or many, rename, share, download etc).
I’ve built a simple front-end with Vuejs and now I’m looking to authenticate to the New Twitch Api as a user. After reading the documentation I found multiple ways to do authentication.
I think that for my use case I need
OIDC Authorization Code Flow
or OAuth Authorization Code Flow
(as far as I understood, OIDC is built on top of OAuth2 to get even more informations on the user returning asked user’s data).
I made a function to authenticate like so
const rp = require('request-promise');
export function OAuth(client_id) {
const options = {
uri: 'https://id.twitch.tv/oauth2/authorize',
qs: {
client_id,
redirect_uri: 'http://localhost:8080/dashboard',
response_type: 'code',
scope: 'clips:edit',
},
headers: {
'Access-Control-Allow-Origin': 'http://localhost:8080',
accept: 'application/vnd.twitchtv.v5+json',
},
json: true,
};
return rp(options);
}
But for some kind of reason my browser keep telling me that access-control-allow-origin
is missing from the headers. I also tryied to replace http://localhost:8080
by *
but nothing is changing.
Before posting here, i red about this post on the forum CORS - Wrong ‘Access-Control-Allow-Origin’ header but I could not find any result who help me.
If you have some hints or advices I would love you read them, thank you.