Authentication in php with oAuth

I’m totally new to APIs in general only have some php experience.

I just basicly need a button to login via twitch and then I can read their username.

This isn’t secure information so there isn’t a token needed.

But as far as I understand correctly, I have to do it anyways to get a token and then get the username.

My problem is twitch spits out

"error": "Bad Request",
"status": 400,
"message": "client does not exist"

I used this url out of a tutorial[clientid]&redirect_uri=[http://localhost:8000/]&scope=[user_read]

clientid is obviously my Application ID that I have censored

And here is the tutorial I was following

Any help would be really cool!

Hey, remove the [] brackets from the URL.

For example:

Thanks just a quick 2nd question.

The token appears in the url after you get redirected can I use that token in the URL?

I have it in php with the function $_SERVER['QUERY_STRING']

but the offical API documentation says I need to use


But I don’t know how to use this “post”

You will need to make the POST request as specified in the Authentication doc. For background you can read about POST here: . Essentially it is the method data is sent from forms on websites to the server.

I did a quick google search for sending a POST request from PHP and found:

If you are using a framework, I would suggest looking into a more specific way to do it from within that framework as it may be cleaner and in better practice.

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