hackalive Posted April 6, 2012 Share Posted April 6, 2012 Hi guys, I have managed to get all my oAuth to work (basically), however the autorize.php is getting this error when "Allowing". Any ideas why? Only happens once I press allow and it should have redirected to the REDIRECT_URI. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/260463-fatal-error/ Share on other sites More sharing options...
hackalive Posted April 6, 2012 Author Share Posted April 6, 2012 This is the error I get Fatal error: Uncaught {"error":"invalid_client","error_description":"No client id supplied"} thrown in A:\public\lib\OAuth2.php on line 837 Quote Link to comment https://forums.phpfreaks.com/topic/260463-fatal-error/#findComment-1335006 Share on other sites More sharing options...
hackalive Posted April 6, 2012 Author Share Posted April 6, 2012 I have narrowed it down to around line 830 of OAuth2.php if (!isset($inputData)) { $inputData = $_GET; } the $_GET is returning no value, which is wrong. It should be returning all the field values from the form. Quote Link to comment https://forums.phpfreaks.com/topic/260463-fatal-error/#findComment-1335022 Share on other sites More sharing options...
jcbones Posted April 6, 2012 Share Posted April 6, 2012 Questions should be clear and concise, leaving 0 margin for doubt. The reason you are getting no response is: No One Knows What You Are Talking About! 1. Brief statement of what you are desiring to do. 2. Any code that is relative to the problem. 3. How the output is different than what is desired. Follow those steps, and you will get replies. Quote Link to comment https://forums.phpfreaks.com/topic/260463-fatal-error/#findComment-1335026 Share on other sites More sharing options...
hackalive Posted April 6, 2012 Author Share Posted April 6, 2012 Using this oAuth library https://github.com/elbunce/oauth2-php Running authorize.php and clicking "yep" button System is returning Fatal error: Uncaught {"error":"invalid_client","error_description":"No client id supplied"} thrown in A:\public\lib\OAuth2.php on line 837 Reason it is returning that and not doing as it should is because line ~830+ if (!isset($inputData)) { $inputData = $_GET; } $input = filter_var_array($inputData, $filters); is returning no value. If you manually set values (on line 835+) $input["client_id"] = "0123456789ab"; $input["redirect_uri"] = "http://www.google.com.au"; $input["response_type"] = "code"; it works as it should. Hope this now makes senese Quote Link to comment https://forums.phpfreaks.com/topic/260463-fatal-error/#findComment-1335029 Share on other sites More sharing options...
amoxibos Posted February 4, 2013 Share Posted February 4, 2013 (edited) I had the same problem. The problem is that in authorize.php starting on line 53, it is listed <form method="post" action="authorize.php"> <?php print_r($auth_params); foreach ($auth_params as $key => $value) : ?> <input type="hidden" name="<?php htmlspecialchars($key, ENT_QUOTES); ?>" value="<?php echo htmlspecialchars($value, ENT_QUOTES); ?>" /> <?php endforeach; ?> Do you authorize the app to do its thing? <p><input type="submit" name="accept" value="Yep" /> <input type="submit" name="accept" value="Nope" /></p> </form> And name="<?php htmlspecialchars($key, ENT_QUOTES); ?>" is missing echo, so it should be: name="<?php echo htmlspecialchars($key, ENT_QUOTES); ?>" and then the values do get passed and it works out. Edited February 4, 2013 by amoxibos Quote Link to comment https://forums.phpfreaks.com/topic/260463-fatal-error/#findComment-1410019 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.