0

Invalid auth/bad request

I am trying to test the sample script given on the YDN, I changed the key & secret values in the sample script, ran it and I am getting

testserver$ php ffl.php
Couldn't open /tmp/oauth_data_token_storage_.out, assuming we need to get a new request token.
Better try to get a new access token.
Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect)

I am not running this script on the server that I registered with, is that why I am seeing this error message? 

Thanks,
Prashanth
     

by
3 Replies
  • hi Prashanth,

    Which sample script are you trying to run?

    Based on your filename, I am assuming you are trying to use fantasy sports api and the code at:
            http://developer.yahoo.com/fantasysports/guide/GettingStarted.html#GettingStarted-sample

                        Looking at your output:
     
    
    testserver$ php ffl.php
    Couldn't open /tmp/oauth_data_token_storage_.out, assuming we need to get a new request token.

    Have you removed your consumer key from the above output? If you have not, then the file name should ve read like:

    /tmp/oauth_data_token_storage_{your_consumer_key_here}.out
    If you have not removed the consumer key, please check that you ve them defined properly earlier in code.
    
      $consumer_data['test']['key'] = '<INSERT CONSUMER KEY HERE>'; 
      $consumer_data['test']['secret'] = '<INSERT CONSUMER SECRET HERE>';   
    Ensure that you ve correctlty updated your code here with the key and secret values from your project app.
        https://developer.apps.yahoo.com/projects

    
    I am not running this script on the server that I registered with, is that why I am seeing this error message? 
    No, this should not be a problem.

    regards
    Anshu Prateek
    0
  • Also, if the above suggestions are all correct and fine for you, please check your server time and ensure its correct and in sync with NTP.
    The error you are facing can occur if the server time is out of sync, resulting in oauth signature failure.

    regards
    Anshu Prateek
    0
  • I'm having the identical problem with the sample code.  I have verified that the date is correct (I am running the ntp service, but just to make sure I ran ntpdate from the command line).

    The sample code simply will not work for me.
    0
This forum is locked.

Recent Posts

in General - APT