After a quick looks it appears you are not escaping the redirect url before the redirect back to Twitch (mainly the query string).
This should work:
https://api.twitch.tv/kraken/oauth2/authorize?response_type=token&client_id=[mycode]&redirect_uri=http%3A%2F%2Fmydomain.com%2Fvsfederation_site%2Findex.php%3Fpage%3Daccount%26action%3Dtwitch_connect&scope=user_read