Alaa
Alaa

Reputation: 4611

Yahoo returns "signature_invalid" when i use OAuth

I am trying to allow users of my website to login using their Yahoo/Gmail accounts.
Gmail went fine. but in Yahoo i have the following php snippet:

$this->options = array('consumer_key'   => 'My Key from Yahoo', 
    'consumer_secret' => 'My Secret ',
    'server_uri' => 'https://www.yahoo.com',
    'request_token_uri'=> 'https://api.login.yahoo.com/oauth/v2/get_request_token',
    'authorize_uri' => 'https://api.login.yahoo.com/oauth/v2/request_auth',
    'access_token_uri'=> 'https://api.login.yahoo.com/oauth/v2/get_token',);
$getAuthTokenParams = array(
    'xoauth_lang_pref'  => 'en-us',
    'oauth_callback'    => $this->callback_url);//callback to my page
$tokenResultParams = OAuthRequester::requestRequestToken($this->options['consumer_key'], 0, $getAuthTokenParams);

now Yahoo gives

HTTP/1.1 401 Forbidden
Date: Wed, 27 Jul 2011 09:12:19 GMT
P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
WWW-Authenticate: OAuth oauth_problem=signature_invalid
Connection: close
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded

oauth_problem=signature_invalid

in https://developer.apps.yahoo.com/projects i have selected:

delicious social bookmarking (read/write)
Contacts (read)
Social Directory (read/write)

has anybody faced the same problem? have i done anything wrong?
Thanks for your help

Upvotes: 1

Views: 2712

Answers (1)

Arkh
Arkh

Reputation: 8459

As I found yesterday, yahoo's token are huge. Meaning that oauth-php does not store it well so you get bad signature. Here is my solution to the problem: How to use the Yahoo! API with the oauth-php library?

Upvotes: 1

Related Questions