0

Sample code error OAuth

I am trying a sample app for oauth and I can log in the first time but once when I log out I get the error

ERROR - Failed to fetch access token: parameter_absent INFO - Failed to fetch access token, retrying ERROR - Failed to fetch access token: parameter_absent

Source with keys removed:

ini_set('display_errors', false);
YahooLogger::setDebug(true);
YahooLogger::setDebugDestination('CONSOLE');

// use memcache to store oauth credentials via php native sessions
ini_set('session.save_handler', 'files');
if (!file_exists(dirname(__FILE__).'/tmp/')) mkdir(dirname(__FILE__).'/tmp/', 0777);
session_save_path(dirname(__FILE__).'/tmp/');
session_start();

// Make sure you obtain application keys before continuing by visiting:
// https://developer.yahoo.com/dashboard/createKey.html

define('OAUTH_CONSUMER_KEY', 'removed');
define('OAUTH_CONSUMER_SECRET', 'removed);
define('OAUTH_DOMAIN', 'removed');
define('OAUTH_APP_ID', 'removed);

if(array_key_exists("logout", $_GET)) {
// if a session exists and the logout flag is detected
// clear the session tokens and reload the page.
YahooSession::clearSession();
header("Location: sampleapp.php");
}

// check for the existance of a session.
// this will determine if we need to show a pop-up and fetch the auth url,
// or fetch the user's social data.
$hasSession = YahooSession::hasSession(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET, OAUTH_APP_ID);

It is erroring on the YahooSession::hasSession based on my tracing.

Any thoughts?

Thanks

by
0 Replies
This forum is locked.

Recent Posts

in Y!OS SDKs