I’ve been having some problems with registering with different scopes. For example, this throws an error:
https://id.twitch.tv/oauth2/authorize?client_id=<>&response_type=code&redirect_uri=<>&scope=chat:read&state=<>
But this goes fine:
https://id.twitch.tv/oauth2/authorize?client_id=<>&response_type=code&redirect_uri=<>&scope=chat:read user:read:email&state=<>
during my tests, i’ve found out twitch (or something on twitch’s side) apparently doesnt like only one scope (or empty scope) in the request. If a put more than one correct scopes, separated by a single space, and not url-encoded, everything goes well.
The error i get, which is a weird error, is this:
Fastly error: unknown domain: <my-domain-here>.com. Please check that this domain has been added to a service.
Details: cache-ams<some-number>-AMS
- You need to URI Encode your
redirect_uri it looks like you redirect URI got &scope added to the end instead of the scope being passed to Twitch
- Scopes are space seperated with encode to a
+
Also clientID’s are public no need to redacted that
Loose example https://github.com/BarryCarlyon/twitch_misc/blob/main/authentication/user_access_generator/nodejs/views/generator.pug#L59
You error doesn’t look like a Twitch Error, but a error from your system?
So you are saying
https://id.twitch.tv/oauth2/authorize?client_id=mycid&response_type=code&redirect_uri=https://domain.com&scope=chat:read&state=somestate
Which to twitch may say: my redirect URI is https://domain.com&scope=chat:read&state=somestate so you don’t pass any scopes or state to the auth page and then after the redirect something goes awry?
The problem seems to be resolved automatically. My best guess is somewhere in the process there is something passing Fastly servers, and Fastly mistakenly throws an error. I’m not sure if Fastly resolved the problem after a while (which seems likely to me) or it was just me that did something that fixed the problem (i changed some stuff due to other problems, the code is the same though and hasn’t changed).