hello all,
for the last 10 hours i am breaking my head trying to fetch emails from yahoo email service.
i will describe my script flow and please if you think you can help me i will be grateful:
first i will mention that i am using this guide:
http://developer.yahoo.com/oauth/guide/oauth-auth-flow.html1- i got myself consumerKey and secret
2- i downloaded OAuth.php class and ymclinet php class. (i think they are broken

)
3- i created a script that looks like this:
index.php:
CODE
require_once 'yMailClient.inc';
require_once 'yahooOAuth.class.inc';
$ymc = new YMClient($key,$secret);
$callBackUrl = "http://MYWEBSITEURL/CallBackUrl.php?service=yahoo";
$requestToken = $ymc->oauth_get_request_token($callBackUrl);
the response from this call is this:
CODE
Array
(
[0] => Array
(
[oauth_token] => SMALL_TOKEN
[oauth_token_secret] => SECRET_STRING_RESPONSE
[oauth_expires_in] => 3600
[xoauth_request_auth_url] => https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=SMALL_TOKEN
[oauth_callback_confirmed] => true
)
[1] => https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=SMALL_TOKEN
)
i am now building the callbackUrl with the secret value:
CODE
$requestUrl = $requestToken[0]['xoauth_request_auth_url'].'&s='.urlencode($requestToken[0]['oauth_token_secret']);
i redirect the script to here $requestUrl value;
https://api.login.yahoo.com/oauth/v2/reques...;s=SECRET_TOKEN this open the yahoo authentication page.
the user enter his yahooId and password then press on sign in button
(in IE i am getting script error after the click)
CODE
Line: 607
Error: Object required
the next page display "agree" button and the script jump to my callbackUrl.php script after a click
in my callBackUrl script i do this:
CODE
require_once 'yMailClient.inc';
require_once 'yahooOAuth.class.inc';
$tokens = array('oauth_token'=> get_arg('oauth_token'),'oauth_token_secret'=>get_arg('s'),'oauth_verifier'=> get_arg('oauth_verifier'));
$ymc = new YMClient($emailServiceData[$service]['key'],$emailServiceData[$service]['secret']);
$accessToken = $ymc->oauth_get_access_token($tokens);
print_r($accessToken);
the response is always this

:
YMClientException: Access token request failed
what can i do? where i can check why the request failed?
i think my main error was using this pre made class.
google also using oauth with their API it went realy smooth
thanks
Elad