I'm trying to load yahoo users' emails (but I'm stuck on the auth step):
define("APPID", 'dj***NQ--');
define("SECRET", '3***7');
// Include the proper class file
$v = phpversion();
if ($v[0] == '4') {
include("includes/yahoo/ybrowserauth.class.php4");
} elseif ($v[0] == '5') {
include("includes/yahoo/ybrowserauth.class.php5");
} else {
die('Error: could not find the bbauth PHP class file.');
}
$authObj = new YBBauthREST(APPID, SECRET);
//echo APPID;
// If Yahoo! isn't sending the token, then we aren't coming back from an
// authentication attempt
if (empty($_GET["token"])) {
// You can send some data along with the authentication request
// In this case, the data is the string 'some_application_data'
echo 'You have not signed on using BBauth yet<br /><br />';
echo '<a href="'.$authObj->getAuthURL('some_application_data', true).'">Click here to authorize</a>';
return;
}
But I get this error in the yahoo landing page:
Invalid (missing) src or appid
So I'm guessing here is the problem?
echo '<a href="'.$authObj->getAuthURL('some_application_data', true).'">Click here to authorize</a>';
Should I replace 'some_aplication_data' with something else?
Edit:
I've also tried:
$callback = YahooUtil::current_url()."?in_popup";
$auth_url = YahooSession::createAuthorizationUrl(APPID, SECRET, $callback);
echo '<a href="'.$auth_url.'">Click here to authorize</a>';
But it won't create the link or show errors (script dies).