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
I love you, you can’t imagine how much time i wasted trying to diagnose it thinking it must be an error in my application.
I switch to code and it’s the correct flow for my use case.
Thanks again !
system
Closed
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.