Authorizing fails with unsupported_response_type

I am following the Log In with Twitch guide and have run into a problem. When I redirect my user to the oauth2/authorize endpoint, they get directed back to my endpoint with ?error=unsupported_response_type&error_description=Response+type+is+not+supported tacked on.

I have tried setting my response_type parameter to code like the guide says as well as authorization_code but both have the same problem.

This may be a simple error but I am not seeing what is going wrong.
The code that accomplishes this is as follows, I am using guzzle for turning the authorize code into the one I can use if that matters:

require_once 'vendor/autoload.php';


if (!isset($_GET['code'])) { //no auth
        '&redirect_uri=<this file>'.
} else { //maybe auth
    $client = new GuzzleHttp\Client();
        '&redirect_uri=<this file>');
    $res = json_decode($req->getBody());
    $_SESSION['twitch_auth'] = $res['access_token'];
    $redirect_url = "<fancy page>";
    header('Location: '.filter_var($redirect_url,FILTER_SANITIZE_URL));

Seems like you are missing a & here.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.