0

What is the Application URL

I am new to this Yahoo OAuth API. I am trying to learn the API by using the sample program.

I created a new web-based OAuth Application. In the form, there is an entry for 'Application URL'. I put here the location of the sample PHP file on my domain:

e.g., www.mydomain.com/yos/yoauth.php

When I run the sample program, IE gives me an error box saying it can't download yoauth.php from api.yahoo.login.com. I am confused. I am entering the wrong information in Application URL? There is no help button in the form.

Andrew

by
5 Replies
  • Hi,

    I've not seen that particular error before. Would you be able to link me to the application you are making and I can have a look to see what might be causing this error.


    Thanks,

    Tom
    Yahoo! Developer Network
    0
  • Hi Tom,

    Thanks for the offer to help. My application is the sampleapp. It can be found at:

    http://www.fashions.org/yos/yoauth.php

    I set the Application URL to the same path as above. Its PHP code, so I am enclosing a copy of the code:

    <?php

    // The code below can be used to create an Open or OAuth Application.
    // In OAuth Applications, the Consumer Key is known as the API Key.
    // The Consumer Secret is also referred to as the Shared Secret.

    // Include the YOS library.
    require("yosdk/lib/Yahoo.inc");

    // Your Consumer Key (API Key) goes here.
    $consumerKey = "REMOVED";

    // Your Consumer (Key) Secret goes here.
    $consumerKeySecret = "REMOVED";

    // Your application ID goes here.
    $applicationId = "REMOVED";

    // Get a session first. If the viewer isn't sessioned yet, this call
    // will redirect them to log in and authorize your application to
    $session = YahooSession::requireSession($consumerKey, $consumerKeySecret, $applicationId);

    // Get the currently sessioned user. That means the user who is
    // currently viewing this page.
    $user = $session->getSessionedUser();

    // Load the profile for the current user.
    $profile = $user->loadProfile();

    // Fetch the presence for the current user.
    $presence = $user->getPresence();

    // Access the connection list for the current user.
    $start = 0; $count = 100; $total = 0;
    $connections = $user->getConnections($start, $count, $total);

    // Retrieve the updates for the current user.
    $updates = $user->listUpdates();

    // Retrieve the updates for the connections of the current user.
    $connectionUpdates = $user->listConnectionUpdates();

    // Set the Content-Type header with the character set so that
    // special characters are rendered properly.
    header("Content-Type: text/html; charset=utf-8");

    ?>
    <html>
    <head>
    <title>YOS Social Platform Sample Application</title>
    </head>

    <body>
    <h1>YOS Social Platform Sample Application</h1>

    <h2>Profile</h2>
    <?php echo print_html($profile); ?>

    <h2>Presence</h2>
    <?php echo print_html($presence); ?>

    <h2>Connections</h2>
    <?php echo print_html($connections); ?>

    <h2>Updates</h2>

    <h3>Yours</h3>
    <?php echo print_html($updates); ?>

    <h3>Your Connections</h3>
    <?php echo print_html($connectionUpdates); ?>
    </body>
    </html>
    <?php

    /**
    * A simple method that implements print_r/var_dump in a HTML friendly way.
    */
    function print_html($object) {
    return str_replace(array(" ", "\n"), array(" ", "<br>"), htmlentities(print_r($object, true), ENT_COMPAT, "UTF-8"));
    }

    ?>

    Edit: Tom removed Andrew's key secrets from the code. :)
    0
  • Hi Andrew,

    I'm sorry to say it looks like you've run into an active bug we have. Right now there are some problems with OAuth token issuing. Right now I don't have a fix for it, but we are definitely working on it as a high priority. As soon as I have some news I'd be happy to update you. You can email me directly at croucher at yahoo hypher inc dot com.

    You might try adding a delay between asking for a request token and asking for an application token in the PHP SDK. That should be enough to get you up and running to develop with. Once you have authorized the app everything should work as normal.

    You might also try running your app inside the Yahoo Application Platform (YAP). This won't have the same issues as a pure OAuth if you view it via apps.yahoo.com. This would allow you to develop your code and then switch to a regular application once a fix is in place at our end.

    I can only apologize that you've run into this and I'll do everything I can help you work around it while we put a fix in place.

    Tom
    Yahoo! Developer Network
    0
  • QUOTE (sh1mmer @ Feb 19 2009, 02:38 PM) <{POST_SNAPBACK}>
    Hi Andrew,

    I'm sorry to say it looks like you've run into an active bug we have. Right now there are some problems with OAuth token issuing. Right now I don't have a fix for it, but we are definitely working on it as a high priority. As soon as I have some news I'd be happy to update you. You can email me directly at croucher at yahoo hypher inc dot com.

    You might try adding a delay between asking for a request token and asking for an application token in the PHP SDK. That should be enough to get you up and running to develop with. Once you have authorized the app everything should work as normal.

    You might also try running your app inside the Yahoo Application Platform (YAP). This won't have the same issues as a pure OAuth if you view it via apps.yahoo.com. This would allow you to develop your code and then switch to a regular application once a fix is in place at our end.

    I can only apologize that you've run into this and I'll do everything I can help you work around it while we put a fix in place.

    Tom
    Yahoo! Developer Network


    Thanks Tom. I will try your delay suggestion over the weekend and let you know if it works. We've also been learning the YUI APIs as well. So far, things are working there a-ok.
    0
  • Glad you are getting good results from YUI. It's one of my favorites. Let me know if you have any more questions and I'd love to see what I can do to help out.

    Tom
    0

Recent Posts

in OAuth General Discussion YDN SDKs