Create a website with a link to create a user token,
make sure that link has the scopes you need for the EventSub Topics you intend to call, for Channel goals this is - channel:read:goals - as per the topic notes EventSub Subscription Types | Twitch Developers
Send the broadcaster to that website
The broadcaster logs in with Twitch
Completely ignore the created user token
Now create an App Access Token (no scopes needed here)
Subscribe to event sub using the App Access Token.
Basically you need to create a link between your ClientID and the Broadcaster via Generating a user token.
Keep that user token on file in case you need to call the API
EventSub (HTTP Transport) only uses App Access Tokens.
EventSub utilises two a token approach.
As EventSub will check if your ClientID has access to the users scoped data.
Hum … You doesn’t answer to my question, but I found my problem .
First, my problem was : EventSub Subscription Types | Twitch Developers tell to use “a user OAuth access token with scope set to channel:read:goals.” ( so, I understand “an user token”, not an App token )
Second, I forgot the scope “channel:read:goals” when asking the broadcaster token ( maybe because the sentence telling to use this scope is not the same as the others )
Adding the scope, and doing the request with the app token resolve my problem .
App Access Tokens cannot have scopes, scopes only apply to tokens that represent users.
This fixes the issue, but yes I didn’t note (scopes) in my instructions. (Will edit now) The Joys of a pre-coffee incomplete answer
Any EventSub topic that needs a scope, needs you to have done a user oAuth token with that scope.
But the Actual App Access Token you use with EventSub doesn’t have scopes as scopes do nothing on an App Access Token as scopes only apply to users and an App Access Token doesn’t have a user. (This is correct for Twitch oAuth not neccassirily other oAuth services)
I’m asking an user oauth access to do multiple things, including registering the subscriptions .
It’s in this call that I forgot to add the scope, App access Tokens doesn’t ask for scopes .
Yes, and in fact, all the rest is also needed for all the other subscriptions, the only missing part was the scope .
I think my misstake come from things like : in the doc, channel:read:goals is not using the same bloc as other . So I miss it, and so miss to add it when asking the user access token .
I think the documentation about the goal subscription need to be more standard, like other
documentation . ( and I need to read more carrefully too )