0

YQL OST_OAUTH_SIGNATURE_INVALID_ERROR

Can someone explain to me what I'm doing wrong?

I'm able to securely call get_request_token and get_token using HMAC-SHA1 encryption. When I attempt to use the oauth_token retrieved from get_token in a YQL URL, I get an "OST_OAUTH_SIGNATURE_INVALID_ERROR" message. I have no idea what part I'm doing wrong. I've attached a sample request/response, but I can provide step by step request/responses if required

Request Method:GET Status Code:401 Unauthorized Request Headersview source Accept:text/html,application/xhtml xml,application/xml;q=0.9,/;q=0.8 Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3 Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Cache-Control:no-cache Connection:keep-alive Cookie:BA=ba=24768&ip=204.101.172.34&t=1360433870; RT=s=1360625515779&u=&r=http%3A//www.yahooapis.com/forum/Fantasy-Sports-API/YDL-vs-API/1314848557001-b5110587-a952-4118-9538-c7c5f7c97c16 Host:query.yahooapis.com Pragma:no-cache User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17

Query String Parameters oauth_consumer_key=dj0yJmk9R00yU2tJTTFMUTdVJmQ9WVdrOWQzQnZlSEJKTjJrbWNHbzlPRFUzTmpZNU1EWXkmcz1jb25zdW1lcnNlY3JldCZ4PTNi&oauth_nonce=1360626694103002&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1360626694&oauth_token=A%3DvslYGA_spw88yPTyXeyYJ7hp.63ks0Hxe3zBrH_.b_TUYjDHoc0rXRVVOunC_V8wxVvljqIWXGQa3PFWQtUXmMFANYSp8.VWyXjHv_KO1VEaZg3Hyqw9EKnFsbk4n4QvL.K1Sihrgawq3PkIxY9tuVOhf.5ADlhfzl_d0jIp54znzOAhVfHnHaJfIz60GpdbzePQgMtFecpJ_aH.QX6Lp16FY1xs9IO2eZcKQ6ZmLIsPnJzyfhD8GpLTqAdaB04XqWJDaS7rwOOpdNaHqAG20anw9ha3XbN.UPCdwihFowOaqAq92DYgsdLUyibEbETpPNuazu6qKC4M.tveJYRjZcUakAy6tlq5IAeGKXHuHpAG__oTAsuVisLSZoa5dxfIHmtDn74rEya5.VAmxs4R_Y7Y.48PZvAnF7sHK4GMMAHNQW0mJireUIapW3Xu4V2EVBP6LK6jnFOip8.bz4HEuwEReHCri0ohaeg_7FFjnZcWpc2XmpEoSZ4E90OBSE5Qgooco5RP5SOithOcwS0807WB4Bf7BCX6LjOlmvqldyOOlzXqB0rAq3BgFSDKHxuP7fxaii8F4.z2Czkw3nMZV47tSSFvFzW7_Vk1WIRrNLqgTvnwQxIncTIyIHhY7y7GHKj_yFE9V7p2IHK6xmXB4ZHtVZMr3kmPAPemPV5CeQMC.0B3dlNkAQan19D8au6K4yOLDFjIgRC1fD_.l9K4R92GlJ_FpU1tCX3jApLSk.iCPGlGtXGiUa5RpbvSRgODhP4cY1tG1A5ItoCOtRG5mE14yKtYF9SoKvYcETQI4rHoTS0Rqpze97k3&xoauth_yahoo_guid=O7PK4TVRULOIZTP5HAND633SBE&q=SELECT%20*%20FROM%20social.contacts%20WHERE%20guid%20%3D%20me%3B&oauth_signature=7r5zizG74WkSvDDF7hNCCi8t42Q%3D

HTTP/1.1 401 Unauthorized X-YQL-Host: engine3.yql.bf1.yahoo.com WWW-Authenticate: OAuth oauth_problem="OST_OAUTH_SIGNATURE_INVALID_ERROR", realm="yahooapis.com" Content-Type: application/xml;charset=UTF-8 Content-Encoding: gzip Vary: Accept-Encoding Date: Tue, 12 Feb 2013 00:01:01 GMT Server: YTS/1.20.13 Age: 0 Transfer-Encoding: chunked Connection: keep-alive

Please provide valid credentials. OAuth oauth_problem="OST_OAUTH_SIGNATURE_INVALID_ERROR", realm="yahooapis.com" Please provide valid credentials. OAuth oauth_problem="OST_OAUTH_SIGNATURE_INVALID_ERROR", realm="yahooapis.com"

by
3 Replies
  • Just to elaborate, the following happens:

    • Call get_request_token
      • oauth_callback=[my callback url]
      • oauth_consumer_key=[my consumer key]
      • oauth_nonce=[generated]
      • oauth_signature_method=HMAC-SHA1
      • oauth_timestamp=[generated]
      • oauth_version=1.0
      • xoauth_lang_pref=en-us
      • oauth_signature=[calculated based on above]

    get back oauth_token, oauth_token_secret, oauth_expires_in, xoauth_request_auth_url, oauth_callback_confirmed

    get back oauth_token and oauth_verifier from popup

    • Call get_token
      • oauth_consumer_key=[my consumer key]
      • oauth_nonce=[generated]
      • oauth_signature_method=HMAC-SHA1
      • oauth_timestamp=[generated>
      • oauth_token=[from previous get_request_token call]
      • oauth_version=1.0
      • oauth_verifier=[from popup]
      • oauth_signature=[calculated based on above]

    get back oauth_token, oauth_token_secret, oauth_session_handle, oauth_expires_in, oauth_authorization_expires_in, xoauth_yahoo_guid

    • Call http://query.yahooapis.com/v1/yql?
      • oauth_consumer_key=[my consumer key]
      • oauth_nonce=[generated]
      • oauth_signautre_method=HMAC-SHA1
      • oauth_timestamp=[generated]
      • oauth_token=[from previous call, updated and much longer]
      • oauth_yahoo_guid=[from previous call]
      • q=SELECT * FROM social.contacts WHERE guid = me;
      • oauth_signature=[calculated based on above]

    get back a OST_OAUTH_SIGNATURE_INVALID_ERROR error

    I've generate the signature the same way for all three calls, but with the last one, it always fails. What am I doing wrong?

    0
  • Here is the percent-encoded query: SELECT%20%2A%20FROM%20social.contacts%20WHERE%20guid%20%3D%20me%3B

    0
  • Figured out how to do it by not using YQL at all. It seems that YQL with OAuth just didn't want to work, so I ended up using the REST API and it worked perfectly.

    0

Recent Posts

in YQL