1

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

Alaa
  • 4,471
  • 11
  • 50
  • 67
  • Note that if you change the permissions you are requesting (contacts, social directory, etc.) Yahoo will change your client id and secret. So if you copied those values before you made changes, it will not work. Make sure you are using the latest values. – Eran Hammer Jul 29 '11 at 17:44

1 Answers1

1

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?

Community
  • 1
  • 1
Arkh
  • 8,416
  • 40
  • 45