PHP Classes

Error: oauth_problem=parameter_absent&oauth_parameters_absent=oa

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  How to Implement PHP ...  >  All threads  >  Error:...  >  (Un) Subscribe thread alerts  
Subject:Error:...
Summary:After isolating the Sign() function... error is returned.
Messages:8
Author:Luesak Luesukprasert
Date:2014-10-13 03:03:43
 

  1. Error:...   Reply   Report abuse  
Picture of Luesak Luesukprasert Luesak Luesukprasert - 2014-10-13 03:03:43
Manuel,

On this line:
if (!$this->Sign($url, $method, $parameters, $oauth, $request_content_type, $value_parameters, count($files) !== 0, IsSet($options['PostValuesInUR

in SendAPIRqeuest... initially I got $value_parameters is undefined.

so I went ahead and added $value_parameters = array() right at the top of the function. After I did that I got the error:
oauth_problem=parameter_absent&oauth_parameters_absent=oa


Please help!

Thanks

Kim

  2. Re: Error:...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-10-13 03:42:27 - In reply to message 1 from Luesak Luesukprasert
What is the code of the CallAPI call that you are using? Is it of some example script?

  3. Re: Error:...   Reply   Report abuse  
Picture of Luesak Luesukprasert Luesak Luesukprasert - 2014-10-13 06:13:05 - In reply to message 2 from Manuel Lemos
Hi,

I'm running the demo login_with_flickr.php

All I did is put my key and secret.

This all used to work before the Sign isolation.

Thanks

Kim

  4. Re: Error:...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-10-13 07:47:35 - In reply to message 3 from Luesak Luesukprasert
Yes, the value parameters was not meant to be used outside that function but that was not the issue. For Flickr the request parameters need to be passed in the URL but the function was not taking the URL parameter by reference.

It is fixed in the version that I just uploaded. Just let me know if you find other issues.

  5. Re: Error:...   Reply   Report abuse  
Picture of Luesak Luesukprasert Luesak Luesukprasert - 2014-10-13 09:42:44 - In reply to message 4 from Manuel Lemos
Thanks! Login seems to work now.

However, I'm trying to upload files but I'm getting invalid signature.. and Flickr document seems to be outdated!

I wonder if typically the access_token needs to be part of the parameter used in creating the oauth signature? Do you know? If so please help!

I've actually tried it both ways... including the access token into the parameters and not including... either way I get invalid signature! :(


Kim

  6. Re: Error:...   Reply   Report abuse  
Picture of Luesak Luesukprasert Luesak Luesukprasert - 2014-10-13 09:44:01 - In reply to message 5 from Luesak Luesukprasert
This is what I get back from Flickr:
oauth_problem=signature_invalid&debug_sbs=POST&https://up.flickr.com/services/upload/&description=&hidden=2&is_public=1&oauth_consumer_key=e54e4c0361b434276577c924ec85f26f&oauth_nonce=fd3f8deb39763cdf833013a409bcf717&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1413193136&oauth_token=72157648140114859-7d9146a9cc40c398&oauth_version=1.0&safety_level=1&tags=&title=Stairs%201.png

  7. Re: Error:...   Reply   Report abuse  
Picture of Luesak Luesukprasert Luesak Luesukprasert - 2014-10-13 09:55:26 - In reply to message 6 from Luesak Luesukprasert
GOT IT!!! UPLOAD SUCCESS...

Turns out...

BAD:
$oClient->Sign($sUrl, "POST", $oReqData, array(), "multipart/form-data", false, false, $sAuth, $aPostValues);

GOOD:
$oClient->Sign($sUrl, "POST", array(), $oReqData, "multipart/form-data", false, false, $sAuth, $aPostValues);

The 3rd and 4th param must be swapped... not sure if this is a problem or not.

  8. Re: Error:...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-10-13 21:12:59 - In reply to message 7 from Luesak Luesukprasert
I am not sure what you are doing, but $parameters are for the API call and $oauth are OAuth 1 specific parameters.