Hello,
I’m trying to create a twitch login system for my website!
My website is hosted @ a Windows VPS using wamp server.
I tried to create a login system, Authentication does works and I do get a code “[my redirect uri]/?code=#codehere”, but when I use this code to generate an Auth Token, It fails. I tried the same using a shared-hosting account with Hostinger and it succeeded in generating an Auth Token.
This can be done locally. I’ll need some more information to help with this. What is the error message that you receive? Which endpoint are you calling? I’m assuming since you’re getting the Auth Code that your Redirect URI is set to http://localhost in the Settings page for your app?
I guess maybe it’s cURL is giving me issues how ever trying echo 'Curl: ', function_exists('curl_version') ? 'Enabled' : 'Disabled'; on a php script echo’s Curl: Enabled
Help appreciated!
Thanks!
Edit
I Got cURL Working By Adding curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);Beforecurl_exec(): Which Works Like A Charm!
New Question
Can I Get this token 1 time, save it in my mySql Data base And Use It Multiple Times? Or Do These Expire?
I’m guessing it is just how you’re adding the data to cURL. There is a good community thread about this over here with examples in PHP cURL: Redirect URI/Login Authentication
The tokens don’t expire. For storage, I would recommend looking into best practices around security for storing OAuth tokens. These tokens can be used to take action on behalf of a user so be security-minded when handling them.