Hello , I’m using nearly 1:1 the example code from the twitchio help page to subscribe to follow events.
I get always “Exception subscribing event: 403: Failed to fulfill the request: Forbidden”.
I setup everything needed:
From outside working callback endpoint with ssl veryfied hostname
Requests are forwarded to the according machine via port 4000
Created an application in the developer console and use the working client secret and id
Working token for the Bot (was existing already before I generated the application client secret and id)
Channel name is correct
broadcaster and moderator ID is the same (my own twitch integer ID)
I have no idea why this is happening. I replaced the bot listener by an own webserver to see if there is an attemp to call the callback. But this does not happen.
Any idea what causes this problem? Is there somewhere a token scope missing I didn’t see?
Good hint!
I created a new token on twitchtokengenerator.com with this scope, but unfortunately it behaves the same as before and the subscription attempt still fails with 403
You really shouldn’t be using 3rd party token generators as that just complicates debugging and has its own issues. Did you use your credentials on that site, so when you went through the OAuth flow with that scope it was authorizing your account to your app, and not that other devs token gen app?
Other things to check is that you’re sending the broadcaster and moderator ID’s correctly in the request, they’re strings not integers. Also it would be helpful for you to log the response body as that will give you a full error.
Thanks @Dist !
Passing the IDs as string and add moderator:read:followers scope fixed it. I get now follower events.
Because the Twitchio lib is handling everything needed for EventSubs I didnt find a way to see the payload of the communication behind. However, its working now.
Also thanks for the warning this was the first try and later I will no more use the 3rd party token generator.
It took me another day to get it to run without the 3rd party Twitchtokengenerator.
Finally:
I use the “Authorization code grant flow” to produce the user token with the scopes. This is neccessary only once.
As redirect use a localhost address in the ‘Application’ settings in the dev console as mentioned in the documentation.
The application uses later the refresh token to get a new token every time it starts connection.
I could only get the TwitchIO example above to work if I also add the chat:read scope. Without I could subscribe to the events but couldn’t start the bot. (… Login unsuccessful with token …)
With these scopes it works for me: moderator:read:followerschannel:read:subscriptionschat:editchat:read
A can’t understand why I need chat:read scope. I dont read any chat messages, I just want to get the channel events and respond with a chat message, thats it.
However, I just can tell: It was not funny to figure this out! I think I generated millions of tokens before it worked
Again thanks to every response to my question!