0

Failed Domain Validation and Application Execute

hi!

when i try to submit an oauth application in https://developer.yahoo.com/dashboard/ mode web-based and i set as my domain localhost, the service of check said me "domain verification failed". if i do the same but i set as domain mysite.altervista.org it's ok.
when, on browser, i point on the url where there's the file mysocial.php with the correct api_key and shared_secret the application return
fatal error: call to a member function getSessionUser() on a non-object in ...

why this? i do how it's write in this page https://developer.yahoo.com/social/php_guid...leshooting.html
but in a case don't work the validation for the key and in the other case the application

thanks for the collaboration
Lucio

by
7 Replies
  • Hi, we don't support "localhost" as a valid domain. You must own your own domain to use OAuth for web applications.
    0
  • ah ok, thanks for the answer
    and for the second cause, those of the application don't getSessionUser regard my credentials correct?

    thanks again
    Lucio
    0
  • Hi luciosampo,

    Usually this is caused by incorrect keys (one's not for the application) or invalid permissions. I know you mentioned that you had the right keys in place but could you please double check that:
    - The keys are indeed for the application you're running (sometimes underscores in the app key get missed during copy/paste)
    - Your permissions on the app are correct (accessing private data, etc.)

    If those are both fine can you please attach the code chunk you're using?

    Thanks,

    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network

    QUOTE (luciosampo @ Nov 19 2008, 11:54 PM) <{POST_SNAPBACK}>
    ah ok, thanks for the answer
    and for the second cause, those of the application don't getSessionUser regard my credentials correct?

    thanks again
    Lucio
    0
  • Hi!

    i check the permission and are all correct (private data ok, with yahoo profile, status, activities and adress book abilitied) ... also the key are correct

    in the first example i use the code of mysocial.php of yahoo sdk (you can test this at the site http://socialnetworking.altervista.org/mysocial.php)
    in the second example i use the code of sampleapp.php of yahoo sdk library (you can check to http://socialnetworking.altervista.org/sampleapp.php)

    in the first case my api_key, shared_secret and application_id (this last don't used in the code) are

    in the second case (where also application_id it's used) are



    in all two test the error is the same:
    Fatal error: Call to a member function getSessionedUser() on a non-object

    thanks very much for the support
    Lucio
    0
  • Hi luciosampo,

    Since it isn't a problem with the keys or permissions, could you please copy/paste the PHP code you're using here? I've tested out the process with the following code and didn't have any issues:

    CODE
    <?php
    require_once('Yahoo.inc');

    //define constants to store your API Key (Consumer Key) and Shared Secret (Consumer Secret)
    define("API_KEY","KEY HERE");
    define("SHARED_SECRET","KEY HERE");

    //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();
    ?>
    0
  • with this code i obtain this response:
    401 Forbidden
    * Custom port is not allowed or the host is not registered with this consumer key.

    CODE
    <?php
    require_once('Yahoo.inc');

    //define constants to store your API Key (Consumer Key) and Shared Secret (Consumer Secret)
    define("API_KEY","dj0yJmk9c0RDQ0o1dTkwYjZYJmQ9WVdrOWFUbEdiRkZLTTJVbWNHbzlNVEl4TnpJd056UXhOZy0t
    JnM9Y29uc3VtZXJzZWNyZXQmeD05Ng--");
    define("SHARED_SECRET","6f5478b5fab8aefc159f3a1dd946b16c010c73f6");

    //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();
    ?>


    and with this, where i only change the key, i obtain the same answer

    CODE
    <?php
    require_once('Yahoo.inc');

    //define constants to store your API Key (Consumer Key) and Shared Secret (Consumer Secret)
    define("API_KEY","dj0yJmk9ZTI5WnFyYnFuYWduJmQ9WVdrOU9FaDBSRTU2TkcwbWNHbzlNVEk0TVRVMU16Z3pNQS0t
    JnM9Y29uc3VtZXJzZWNyZXQmeD02YQ--");
    define("SHARED_SECRET","b72daf273fcb43c9c11fc0dbb3d72593f3ae9dc9");

    //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();
    ?>


    i don't know why ...
    0
  • i'm sorry, but a wrong the response...
    the answer is this Fatal error: Call to a member function getSessionedUser() on a non-object in /membri/socialnetworking/mysocial.php on line 12 and not that of previous post
    0
  • anything solution?
    0
  • 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?
    0

Recent Posts

in OAuth General Discussion YDN SDKs