I can't access the parameters of the request

You are doing implict auth.

This will return a token that is in the #fragment fragments cannot be accessed by server side code.

Some javascript on the client will provide access:

For example: Twitch Implicit Auth Example - snippet:

        if (document.location.hash && document.location.hash != '') {
            var parsedHash = new URLSearchParams(window.location.hash.slice(1));
            if (parsedHash.get('access_token')) {
                var access_token = parsedHash.get('access_token');

It sounds like you may be using the wrong token flow if you need to get the token into a server side script. You may need to be using the code flow to generate a code you exchange for a token.

Or you need to use some javascript, as above, to extract the token and then push that to your server, but the code flow is preferred.

TLDR:

You are using implicit for getting a token, so need to extract the token using JavaScript - Getting OAuth Access Tokens | Twitch Developers

But I’m not sure if you need to be using code flow instead - Getting OAuth Access Tokens | Twitch Developers as it’s unclear from your use case as described

1 Like