0

Callback and signature problem

Hello all,

I have a web-application and I want to enable my users to access their Yahoo contacts through the API.
However, first thing first - I want to authenticate the user.

I have this code:

CODE
<?php
require_once 'network.php';
require_once 'yahoo/Yahoo.inc';

define('OAUTH_CONSUMER_KEY', 'XXXXXXXXXXXX');
define('OAUTH_CONSUMER_SECRET', 'XXXXXXXXXXXX');
define('OAUTH_DOMAIN', 'http://www.simwrite.com');
define('OAUTH_APP_ID', 'XXXXXXXXXXXX');

class YahooNetwork extends Network
{
public function __construct($username, $password = NULL)
{
$this->name = "yahoo";
parent::__construct($username, $password);
}

public function login()
{
// debug settings
error_reporting(E_ALL | E_NOTICE); # do not show notices as library is php4 compatable
ini_set('display_errors', true);
YahooLogger::setDebug(true);
YahooLogger::setDebugDestination('LOG');

$callback = 'http://www.simwrite.com/~temp776/borisd/login.php';
echo YahooSession::createAuthorizationUrl(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET, OAUTH_DOMAIN);
}
}


When I run this, I manage to successfully get an authorization URL. However, when I change the last parameter in the createAuthorizationUrl call to $callback, it stops working and claims: oauth_problem=signature_invalid. My application's registered URL is the one in $callback, and its registered domain name is in OAUTH_DOMAIN. The real script which needs to handle the user when he is redirected back is at login.php, and I can't manage to pass it as callback.
This is very frustrating, as the SDK should supposedly make all of this process much easier, and I act accordingly to the documentation. However, this has already taken me several hours and I can't find any leads.

Any help would be appreciated. Thanks in advance.

by
3 Replies

Recent Posts

in OAuth General Discussion YDN SDKs