The URI you set when you created the application in your Twitch account settings and the one pass to “kraken/oauth2/authorize” must be exactly the same for this error will occur.
The subdomain (with or without www) that you are hosting your website on does not matter as long you match your app settings to the authorize call.