After seeing your post.
And then testing it
And then having it not working
And then had a DM with Some TwitchDevs about something else, where I mentioned this post.
Here is the answer:
NodeJS:
var url = oidc_data.authorization_endpoint
+ '?client_id=' + config.twitch.client
+ '&redirect_uri=' + config.twitch.redirect
+ '&response_type=code'
+ '&scope=' + oidc_data.scopes_supported.join('+')
+ '&claims=' + JSON.stringify({
userinfo: {
email:null,
email_verified:null,
picture:null,
preferred_username:null
}
});
Where oidc_data is the output of https://id.twitch.tv/oauth2/.well-known/openid-configuration
Where this URL is the URL you would redirect people to, in order to authenticate with Twitch.