0

get_request_token FORBIDEN

Hello,

I triend to use Yahoo! OAuth but I had errors, I was looking in this forum without success, can you help me to find what's wrong?

The URL:

CODE
https://api.login.yahoo.com/oauth/v2/get_request_token
?oauth_nonce=5D25B4A5BCAEC52026B2C8F5d8CC282E
&oauth_timestamp=1307489068
&oauth_consumer_key=dj0yJmk9aTVHUHdpdE9oTUhXJmQ9WVdrOVJFNXlhbGw2TkhFbWNHbzlNV
Ek0TXpjd05UWTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD0yNg--
&oauth_signature_method=HMAC-SHA1
&oauth_signature=090640ffe14fbb20726fccc13175cd6bb5d938ce%26
&oauth_version=1.0
&xoauth_lang_pref=en-us
&oauth_callback=http%3A%2F%2Fnew.anezi.net


The Error message:

CODE
HTTP/1.1 401 Forbidden

by
4 Replies
  • No response?

    Thanks in advance.
    0
  • It's been about a year, still no response? I guess this issue is so hard to fix.
    0
  • Try this

     

    <?php
    $currentdate=date('Y-m-d H:i:s');
    $timestamp=strtotime($currentdate);
    $v1=rand(1000,8000);
    $v2=rand(10,99);
    $noncestr="$timestamp.$v1.$v2";

    //--EDIT THESE THREE LINES
    $con_token="ADD_YOUR_CONSUMER_KEY_HERE";
    $con_secret="ADD_YOUR_CONSUMER_SECRET_HERE";
    $con_domain="http://www.yourdomain.com";
    //--END EDIT

    $ch = curl_init("https://api.login.yahoo.com/oauth/v2/get_request_token?");
    $url="";
    $url.=urlencode("oauth_nonce");
    $url.="=";
    $url.=urlencode($noncestr);
    $url.="&";
    $url.=urlencode("oauth_timestamp");
    $url.="=";
    $url.=urlencode($timestamp);
    $url.="&";
    $url.=urlencode("oauth_consumer_key");
    $url.="=";
    $url.=urlencode($con_token);
    $url.="&";
    $url.=urlencode("oauth_signature_method");
    $url.="=";
    $url.=urlencode("plaintext");
    $url.="&";
    $url.=urlencode("oauth_signature");
    $url.="=";
    $url.=urlencode($con_secret);
    $url.="&";
    $url.=urlencode("oauth_version");
    $url.="=";
    $url.=urlencode("1.0");
    $url.="&";
    $url.=urlencode("xoauth_lang_pref");
    $url.="=";
    $url.=urlencode("en-us");
    $url.="&";
    $url.=urlencode("oauth_callback");
    $url.="=";
    $url.=urlencode($con_domain);

    curl_setopt($ch, CURLOPT_POSTFIELDS,  $url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $output=curl_exec($ch);   
    curl_close($ch);

    // SHOW THE RESULT
    echo $output;
    ?>


    0

  • Sorry I forgot to add at the end of the CONSUMER_SECRET you need to add an "&" sign with no spaces.
    0

Recent Posts

in OAuth General Discussion YDN SDKs