I want to know how i get the access token

I have been trying for a long time to get the access token, I am using the Oauth token generator site but I want to keep the access token in a variable, how will I do this if not even the redirect appears in the get request ??

Instead of using someone elses generator, you should build your own.

Makes it easier to utilize storing and retrieval of the access codes. And means you can use a server to server/app access/Client Credentials token, instead of a user token where relevant

I tried and even managed to get it to show the token in the url but how do I get the token and store it in a variable?

That sounds liek you are using implicit auth and the credential is in as a URI Fragment which server code cannot see.

You should be using

instead for user tokens

Ok I did as in the doc, now, how do I get the url of the redirect? it contains the token

the URL you redirect to is to a server you control and where your code runs.

Only you know what your redirect will be

Not sure if I can add a pointer to help you out Gustavo, but you could use http://localhost as a redirect url if you don’t have a server running he code, then on your browser go o that whole url that will look like this:

https://id.twitch.tv/oauth2/authorize?client_id=<your client id>&redirect_uri=http://localhost&response_type=code&scope=<scopes you need>

When you go to that url from the browser, the url will then contain a code=sdkjff9k032kedfm, then you can use that code to get your oauth token.

Hope this helps

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