0

user can't login through yahoo

Hi!

I have a problem. I wanna create a script where user can login throught yahoo

http://yap-studio.com/apps/tv-blog/
source [http://developer.yahoo.com/social/updates/packages/tv-blog-demo_1.1.zip]

ive changed config.inc - inserted my consumer key, consumer secret and application ID.
added correct path for Yahoo.inc
added JSON.php and QAuth.php the same dir where is Yahoo.inc

I get the following error when requesting an unauthorized request token (first stage of OAuth):

OAuth Error: Custom port is not allowed or the host is not registered with this consumer key.

I have tried to understand where this script performing breaks and went till the place,
where the following method getting called out YahooAuthorization::getRequestToken.

after implementation of this line in that method (YahooAuthorization::getRequestToken)

$response = $client->post($request_url, "application/x-www-form-urlencoded", $parameters);
$response[responseBody] => OAuth Error: Custom port is not allowed or the host
is not registered with this consumer key.
and $response[code] => 401

and YahooLogger::setDebugDestination('CONSOLE'); is showing
ERROR - Failed to create request token2: unknown problem
ERROR - Request token doesn't have a 'key' property


here are the keys, that I use
define("API_KEY","dj0yJmk9TEJ6aU5RUVpIakVhJmQ9WVdrOWVWbHZkbGx5TmpRbWNHbzlNVFkxTkRVNE5EZ3pPUS0
tJnM9Y29uc3VtZXJzZWNyZXQmeD0xZQ--");
define("SHARED_SECRET","6f8cad40de1877e72d617823270d22eb017fda01");

here is a script, that I made for keys verification
url: http://apps.yahoo.com/-yYovYr64
source:
<?php
require_once('lib/Yahoo.inc');

//define constants to store your API Key (Consumer Key) and Shared Secret (Consumer Secret)
define("API_KEY","dj0yJmk9TEJ6aU5RUVpIakVhJmQ9WVdrOWVWbHZkbGx5TmpRbWNHbzlNVFkxTkRVNE5EZ3pPUS0
tJnM9Y29uc3VtZXJzZWNyZXQmeD0xZQ--");
define("SHARED_SECRET","6f8cad40de1877e72d617823270d22eb017fda01");

//initializes session and redirects user to Yahoo! to sign in and then authorize app
$yahoo_session = YahooSession::requireSession(API_KEY, SHARED_SECRET);

//get currently logged in user
$yahoo_user = $yahoo_session->getSessionedUser();

var_dump($yahoo_user);
?>




here is my app
http://webdev.qarea.org/marcoss/yahoo/login/

u can see debug info in firebug console

Could you please show me where is my mistake and what do I do wrong?

by
5 Replies
  • QUOTE (Constantine @ Oct 23 2009, 08:22 AM) <{POST_SNAPBACK}>
    Hi!

    I have a problem. I wanna create a script where user can login throught yahoo

    http://yap-studio.com/apps/tv-blog/
    source [http://developer.yahoo.com/social/updates/packages/tv-blog-demo_1.1.zip]

    ive changed config.inc - inserted my consumer key, consumer secret and application ID.
    added correct path for Yahoo.inc
    added JSON.php and QAuth.php the same dir where is Yahoo.inc

    I get the following error when requesting an unauthorized request token (first stage of OAuth):

    OAuth Error: Custom port is not allowed or the host is not registered with this consumer key.

    I have tried to understand where this script performing breaks and went till the place,
    where the following method getting called out YahooAuthorization::getRequestToken.

    after implementation of this line in that method (YahooAuthorization::getRequestToken)

    $response = $client->post($request_url, "application/x-www-form-urlencoded", $parameters);
    $response[responseBody] => OAuth Error: Custom port is not allowed or the host
    is not registered with this consumer key.
    and $response[code] => 401

    and YahooLogger::setDebugDestination('CONSOLE'); is showing
    ERROR - Failed to create request token2: unknown problem
    ERROR - Request token doesn't have a 'key' property


    here are the keys, that I use
    define("API_KEY","dj0yJmk9TEJ6aU5RUVpIakVhJmQ9WVdrOWVWbHZkbGx5TmpRbWNHbzlNVFkxTkRVNE5EZ3pPUS0
    tJnM9Y29uc3VtZXJzZWNyZXQmeD0xZQ--");
    define("SHARED_SECRET","6f8cad40de1877e72d617823270d22eb017fda01");

    here is a script, that I made for keys verification
    url: http://apps.yahoo.com/-yYovYr64
    source:
    <?php
    require_once('lib/Yahoo.inc');

    //define constants to store your API Key (Consumer Key) and Shared Secret (Consumer Secret)
    define("API_KEY","dj0yJmk9TEJ6aU5RUVpIakVhJmQ9WVdrOWVWbHZkbGx5TmpRbWNHbzlNVFkxTkRVNE5EZ3pPUS0
    tJnM9Y29uc3VtZXJzZWNyZXQmeD0xZQ--");
    define("SHARED_SECRET","6f8cad40de1877e72d617823270d22eb017fda01");

    //initializes session and redirects user to Yahoo! to sign in and then authorize app
    $yahoo_session = YahooSession::requireSession(API_KEY, SHARED_SECRET);

    //get currently logged in user
    $yahoo_user = $yahoo_session->getSessionedUser();

    var_dump($yahoo_user);
    ?>




    here is my app
    http://webdev.qarea.org/marcoss/yahoo/login/

    u can see debug info in firebug console

    Could you please show me where is my mistake and what do I do wrong?



    The issue looks like the domain you are using to make the oauth request is not the domain that was used to create the consumer key and shared secret. Can you create a new consumer key/secret in the developer dashboard: http://developer.yahoo.com/dashboard
    0
  • QUOTE (Dustin Whittle @ Nov 1 2009, 04:39 PM) <{POST_SNAPBACK}>
    The issue looks like the domain you are using to make the oauth request is not the domain that was used to create the consumer key and shared secret. Can you create a new consumer key/secret in the developer dashboard: http://developer.yahoo.com/dashboard


    Hi Dustin,

    I have the same problem that @Marcoss "OAuth Error: Custom port is not allowed or the host is not registered with this consumer key." so i created a new consumer key/secret as you said and It worked for a while, but now l have the same problem that i had before

    i can create a ROBOT to make a new consumer key/secret and update my configuration file... but i don't think so that's the right way :)
    0
  • Hi rscattini, is the URL defined for the OAuth application teh same URL used in the callback_url parameter as Dustin mentioned?

    - Jon
    0
  • QUOTE (Jonathan LeBlanc @ Mar 11 2010, 10:51 AM) <{POST_SNAPBACK}>
    Hi rscattini, is the URL defined for the OAuth application teh same URL used in the callback_url parameter as Dustin mentioned?

    - Jon


    Hi Jon,

    do you mean that when I register an app, the field "Application URL" or "Application Domain",
    have to be exactly the same that my callback_url that I do passing through parameter??...

    btw, the domain is the same

    - Ricardo
    0
  • Yes, the application URL will need to be the same as the callback URL - a discrepancy between those values is generally the cause of this error.

    - Jon
    0

Recent Posts

in YAP