Issues by getting oauth access token

Hello there ! :smiley:

I’m trying to get an “OAuth authorization code flow” but I’m simply lost about how to do that…

I have tried the request below with all correct informations inside my CLI with CURL :

GET https://id.twitch.tv/oauth2/authorize
    ?client_id=<your client ID>
    &redirect_uri=<your registered redirect URI>
    &response_type=code
    &scope=<space-separated list of scopes>

So the request response is 200 but, where is the generated code ? I’ve got a JSON response but with StatusCode, Content, RawContent, etc… but no oauth code here :confused:

I have tried to read inside the “Content” parameter but there is no code, I’m so lost about getting this token.

Is there something I did wrong ?

Thank you so much for your help ! :slight_smile:

You need to actually go to that URL in your browser, not use a request library like cURL.

On that page Twitch will ask if you want to connect to that app and grant it the scopes you’re asking for.

If you accept you’ll be redirected to your redirect URL with a code param that can be exchanged for an Access Token and Refreah Token.

1 Like

Oh okay, I see… I didn’t understand to do things like that. So I did what you told me and it works, I get the code inside the URL.

Thank you so much for your help ! :slight_smile:

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