0

Signature from YAP failed.

Hey, if anyone has any thoughts.

Trying to build our first yahoo app, and it's been nothing but a nightmare for us.

At this point, I'm receiving "Signature from YAP failed".

Steps taken: Changed Consumer Key, Changed Secret Key, changed timestamp to properly reflect Eastern Standard Time.

Code: Straight out of the manual (as this is strictly a PHP wrapper for our j2ee/perl environments.

CODEBOX
	define('ROOT',$_SERVER['DOCUMENT_ROOT'] . '/'); //document root folder
define('MEMBERS',ROOT.'members/'); //members logged in
define('SOURCE',ROOT.'canvas/'); //canvas (this) folder
define('INC',ROOT .'php_inc/'); //php secure includes - must be private at launch

require_once(INC.'errors.php'); //error reporting, etc
require_once(INC.'Yahoo.inc'); //yahoo api, etc
require_once(INC.'YahooSessionStore.inc'); //yahoo session store

define('OAUTH_APP_ID', 'p2bgPG7e');
define('OAUTH_DOMAIN', 'http://yahoo.kornerstoneintldev.garohosting.com/canvas');
define('OAUTH_CONSUMER_KEY', 'dj0yJmk9QjBLZGVmZXQybVRNJmQ9WVdrOWNESmlaMUJITjJVbWNHbzlNVE0xTlRBNE9USTNOdy0t
JnM9Y29uc3VtZXJzZWNyZXQmeD1lMA--');
define('OAUTH_CONSUMER_SECRET', '6cd6c3e661b3d07fa1f29bd0e092221752b8fd11');

echo time()+6273;
YahooLogger::setDebug(true);
YahooLogger::setDebugDestination('CONSOLE');

ini_set('session.save_handler', 'files');
session_save_path('/tmp/');
session_start();
//print_r($_REQUEST);
/* 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();
}

// 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);
/*


Changes to yahoo.inc:

CODEBOX
return setcookie("yosdk_rt", "", time()+6273 - 600); //changed all instances

time()+6273 //changed everywhere


Yes, that is the valid keys, considering they will be changed eventually.

Any help would be greatly appreciated - need to port over a bunch of apps to Yahoo.

by
3 Replies
  • Also forgot to mention: I'm getting - We could not update your App at this time. Please try again. every time i attempt to update to live.
    0
  • Update: After searching through oath.php I found some minor time problems and fixed them. I have since gotten rid of 1 error that i found relating to timestamp irregularities.

    However, sill getting a signature failure. Here is the code that it's spitting out to me now (full debugging).

    CODEBOX
    <code class="yap-chrome-data" title="{&quot;zoomoutURL&quot;:&quot;&quot;,&quot;loginURL&quot;:&quot;https:\/\/login.yahoo.com\/config\/login?.src=yap&amp;.pd=c%3DAULpZUep2e5BLlEW5FuoArU-&amp;.done=http%3A%2F%2Fapps.yahoo.com%2F-KC3VWC44%2F&quot;,&quot;canvasURL&quot;:&quot;http:\/\/apps.yahoo.com\/-KC3VWC44\/&quot;,&quot;name&quot;:&quot;Recharge Buddy&quot;,&quot;description&quot;:&quot;My application does all sorts of useful stuff.&quot;,&quot;is_yahoo&quot;:false,&quot;screenshot_url&quot;:&quot;http:\/\/ic3.apps.yahooapis.com\/v1\/cache\/public\/hYPYaH2yoa7SREZAJ34SIyXT0UCmtpBpRVi4lU1bNKX0eeO16Cm6vearB4iyPe5o7EuWxuBp0xZiTALA
    UhYT5uMhk4zVdUnqd7UAgvBB3xb4g.s-&quot;,&quot;icon_url&quot;:&quot;http:\/\/ic3.apps.yahooapis.com\/v1\/cache\/public\/DKop7EWyoa70Qt6Ht7kfpZxgIhAfD1W0oQUrXV0ayVqN_f0qZD.COACzBmhuGYb7tQvgFDLwGkaEima.
    3resOKK28ZLnenak1RZqsHoHxSfD&quot;,&quot;developer_url&quot;:&quot;http:\/\/l.yimg.com\/us.yimg.com\/i\/identity\/nopic_48.gif&quot;,&quot;developer_name&quot;:&quot;Paul&quot;,&quot;add_remove_app_crumb&quot;:&quot;&quot;,&quot;chrome_crumb&quot;:&quot;&quot;,&quot;sendmsg_crumb&quot;:&quot;&quot;,&quot;oauth_crumb&quot;:&quot;&quot;,&quot;ctx&quot;:{&quot;lang&quot;:&quot;en-US&quot;,&quot;tz&quot;:&quot;America\/Los_Angeles&quot;,&quot;jurisdiction&quot;:&quot;US&quot;,&quot;from&quot;:&quot;&quot;,&quot;yap_params&quot;:{&quot;yap_intl&quot;:&quot;us&quot;,&quot;yap_js&quot;:&quot;US&quot;},&quot;canvasprefix&quot;:&quot;dev-preview\/&quot;,&quot;script&quot;:&quot;1&quot;,&quot;nonce&quot;:&quot;wfz9nN&quot;},&quot;chrome&quot;:false,&quot;flash_min_version&quot;:&quot;10.0.42.34&quot;,&quot;app_id&quot;:&quot;KC3VWC44&quot;,&quot;ctnr_id&quot;:&quot;-CNTNR44&quot;,&quot;dz_id&quot;:&quot;853760&quot;,&quot;view&quot;:&quot;YahooFullView&quot;,&quot;iid&quot;:&quot;devpreview&quot;,&quot;user_id&quot;:&quot;DTHGHH4P27NCKXZC7QSCYAPD3Q&quot;,&quot;user&quot;:&quot;DTHGHH4P27NCKXZC7QSCYAPD3Q&quot;,&quot;owner_id&quot;:&quot;DTHGHH4P27NCKXZC7QSCYAPD3Q&quot;,&quot;viewer_id&quot;:&quot;DTHGHH4P27NCKXZC7QSCYAPD3Q&quot;,&quot;token&quot;:&quot;pVtAkn9kFBSFc18MxuD1YAUCXWKaF60voxuX43otgDjdHAWLJ2ngaa9v2tuAQ9.Ql_cKmxU
    6sTDyuol9J0LFpq7K7sa5MApb0PkkKP_LXzf74ESgQ3G_RN6VdhjkpktuahaZf6PdryZ9NnoN27t3pYD8
    gMy8ouLrg4tJDkrzSTVYjKhPVdlMKqMz18Gc5QdP9sof.ceGk75YI6gnmbuSpI5x6gSoFW4yRr7WiOdZI
    GAK2lz23npB56dDF5kkM8xxedRash9z532LN463VhFtabncgvsmRTMCQziveM6HH6fj0mlC3qAn90dBIW
    gnoqkb17yRnAgBmFZXceMGJqDuL3lqbS4RztPvfG0ElVbHsali_HgQ3EgGb7d_UgPVw_8ILr14QowvV85
    CB8r3KGs8mC.T5L1ZA_Gwqc.BRnuUju4OlSkwK0w6Qafo2KrC4psRLedYTD53bsp12im0C_At6h6BGmi_
    0.ZKX_NvJgo4cYEijqWOV90O3Tnwtjbqy3YgCbjbjLNSquc0e01uIgxhcKyfZgdVh7BaNW7IfoGg02ROj
    Pm1Rv.Ok0S6yFvwG3gUvEn9_HZlTERe9S.lqftBgo.X8nCDF7KcuNQUK01asLj_TbVbwXDPq.RrVY6ODg
    8CnMvH4NhtCoS.bDSmhs1u3e.LjD3a3wZJ5E2OXv1_.2l7RODdLIMa&quot;,&quot;share_nonconnections_enabled&quot;:&quot;1&quot;,&quot;userLogin&quot;:&quot;Paul&quot;,&quot;message&quot;:{&quot;subject&quot;:&quot;Paul wants to share Recharge Buddy with you&quot;,&quot;body&quot;:&quot;My application does all sorts of useful stuff.&quot;,&quot;image&quot;:&quot;http:\/\/ic3.apps.yahooapis.com\/v1\/cache\/public\/hYPYaH2yoa7SREZAJ34SIyXT0UCmtpBpRVi4lU1bNKX0eeO16Cm6vearB4iyPe5o7EuWxuBp0xZiTALA
    UhYT5uMhk4zVdUnqd7UAgvBB3xb4g.s-&quot;}}" style="display:none!important"></code> <div class='caja-outer'><div class='cajoled' id='cajoled-box'><pre>Array
    (
    [view] =&gt; YahooFullView
    [yap_consumer_key] =&gt; dj0yJmk9UUp0Nmo5ME80UWhqJmQ9WVdrOVMwTXpWbGRETkRRbWNHbzlOVEE0TXpJMk1UZzQmcz1jb25z
    dW1lcnNlY3JldCZ4PTll
    [yap_viewer_access_token] =&gt; A=EfKcN0r.5CqmXmjEbQcq6THgGGlE38TfOuHTSSqzL.GnBhAe26gJdZIm6siXVKsaLFNShuZYKxSyMI
    g8scktaGgsxUeHN88hgvT7WMbWxH_Ro40X51VqJhKWOKKx81Wo4GdANWAUHIOvTf36NkWKm1RW9xJ8IAk
    IB.pO.0puOcByvYOvRuAL.YBdqxesx6r9ldeP52Sz3camLyfPowpdeiJFkEdI3c2DnReKMy.7_roVe1JD
    wuZennMaFUWI_91D_XaD0hJXhD3rexnzErqL33bup_f5dZFaKdQ3s8tbHzUfsla10UlGn70SfhEkC277.
    FcpYkgAhkbod2aZ1gyXmcPxG6sXso_siqrcwQrp9p18pb5xVWXuiUUr4dj2JnAxeWAAwr549kcikQkozd
    fEzfLMhbmocvcvbMupQ9JaC7xapFJVE26o4ji1DQ3Y1wHNn9HXLQD4aZR9zSXPvnlQ5MksrM34.1b3pDZ
    ONYxPUW9K8FDV_1x_aUZpoK0yHg4FzPZFAjokE2Aza8sNaMwJnFm9VMvzahxI1DdkK7PQcx6n66ZZrInU
    _wDblIyGHV2L2bWCqRrJxBhIXO_dZMzjOl2CZHc7N1BcUTZ.KJg8zoLVWHjyuCKFfqyYQC8JcLYCvDE8_
    s3wjQ_OkZE3uBwM8AJFuymIq5XO.VmwRIn5i5ULZZ5tT3w2AF9cfUyhAqvxTs_hqpR8chr9QVbTkXhoU2
    iK6n6js40807dfHTZJ1NvUH3JCy_UeD8g4bSXgmix.Y64bYBacAW8eekI-
    [yap_viewer_access_token_secret] =&gt; 766264a6e697a9a5101d5ec88a4f105245c3a23b
    [yap_viewer_guid] =&gt; DTHGHH4P27NCKXZC7QSCYAPD3Q
    [yap_owner_guid] =&gt; DTHGHH4P27NCKXZC7QSCYAPD3Q
    [yap_tz] =&gt; America/Los_Angeles
    [yap_jurisdiction] =&gt; US
    [yap_appid] =&gt; KC3VWC44
    [yap_dropzone_id] =&gt; 853760
    [yap_view] =&gt; YahooFullView
    [yap_time] =&gt; 1264172131
    [oauth_signature_method] =&gt; HMAC-SHA1
    [oauth_signature] =&gt; MktEPhw8RTr0V0c/Mbn05ZTTlmA=
    )

    </pre><br /><br />1264172518<br /><br />ERROR - Signature from YAP failed.
    DEBUG - HTTP request details
    DEBUG OBJECT - Array
    (
    [method] =&gt; POST
    [url] =&gt; https://api.login.yahoo.com/oauth/v2/get_request_token
    [code] =&gt; 401
    [requestHeaders] =&gt; Array
    (
    [0] =&gt; Accept: application/json
    [1] =&gt; Content-Type: application/x-www-form-urlencoded
    )

    [requestBody] =&gt; oauth_callback=http%3A%2F%2Fyahoo.kornerstoneintldev.garohosting.com%2Fcanvas%2F%3Fview%3DYahooFullView%3Fin_popup&amp;oauth_consumer_key=dj0yJmk9UUp0Nmo5ME80UWhqJmQ9WVdrOVMwTXpWbGRETkRRbWNHb
    zlOVEE0TXpJMk1UZzQmcz1jb25zdW1lcnNlY3JldCZ4PTll&amp;oauth_nonce=be38e05e4c79168b4f9b8f6b82b73521&amp;oauth_signature=%2FLEvDOS6Q4Y4Bmk7bjBqEF5iHYs%3D&amp;oauth_signature_method=HMAC-SHA1&amp;oauth_timestamp=1264172518&amp;oauth_version=1.0
    [responseHeaders] =&gt; Array
    (
    [Date] =&gt; Fri, 22 Jan 2010 14:55:34 GMT
    [P3P] =&gt; policyref=&#34;http://info.yahoo.com/w3c/p3p.xml&#34;, CP=&#34;CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV&#34;

    [Connection] =&gt; close
    [Transfer-Encoding] =&gt; chunked
    [Content-Type] =&gt; text/html; charset=utf-8
    )

    [responseBody] =&gt;

    <div style="margin-top: 90px; background-color: white; margin: 90px 90px; padding: 10px 50px; padding-top: 15px; border: 1px solid #aaadb0; -moz-border-radius: .3em">
    <h1 style="border-bottom: 1px solid #aaadb0">OAuth Error</h1>
    <ul style="font-size: 1.5em"><li>Custom port is not allowed or the host is not registered with this consumer key.</li></ul>
    </div>




    )

    ERROR - Failed to create request token: unknown problem
    ERROR - Failed to create request token
    testing</div></div>
    <script type="text/javascript" src="http://l.yimg.com/kj/yap/combo?/caja/js/y117616/json_sans_eval-7DrmzGViPnX9abjk2kOcZg-.js&amp;/caja/js/y117616/html4-defs-WE7uXl1Re8UdWgpaoj7-fA-.js&amp;/caja/js/y117616/css-defs-ekn6h7mRccSeXLd6795PPQ-.js&amp;/caja/js/y117616/html-sanitizer-zXP04M6tzk8Z1oO5M79TFQ-.js&amp;/caja/js/y117616/cajita-ip4-JGUn-uPkH3CFShDR6Q-.js&amp;/caja/js/y117616/unicode-TMmcqr7XRn8HqZPixui2-A-.js&amp;/caja/js/y117616/html-emitter-NKa6R1WNuAffYNj2HUA1tQ-.js&amp;/caja/js/y117616/setup-valija-aNf136IsdUH8IUqP4CsaTw-.js&amp;/caja/js/y117616/valija.out-ivi9OPK9VaGFV-Xpp88wHQ-.js&amp;/caja/js/y117616/log-to-console-8ZtEPB6njEyOGW2WFERRRA-.js&amp;/caja/js/y117616/cajita-debugmode-7wltb8aeS6SL6pz6UdzlgA-.js&amp;/caja/js/y117616/bridal-uTn8l6wI3f38wKxxKOnvyg-.js&amp;/caja/js/y117616/domita-HwWDR6aIsfJgk2eOS35-rA-.js&amp;/caja/js/y117616/yap_caja-mNouveh1G10f4wTGcWTpHQ-.js"></script><script>cajaInit('cajoled');{
    ___.loadModule({
    'instantiate': function (___, IMPORTS___) {
    var moduleResult___ = ___.NO_RESULT;
    var $v = ___.readImport(IMPORTS___, '$v', {
    'getOuters': {
    '()': { }
    },
    'initOuter': {
    '()': { }
    }
    });
    var $dis = $v.getOuters();
    moduleResult___ = $v.initOuter('onerror');
    return moduleResult___;
    },
    'includedModules': [ ],
    'cajolerName': 'com.google.caja',
    'cajolerVersion': '117800',
    'cajoledDate': 1264172134440
    });
    }</script>
    </div><div><b>Debug Messages:</b><br><pre>stdin:stdin:41: [responseBody] =&gt; &lt;html&gt;&lt;title&gt;OAuth Error&lt;/title&gt;
    ^^^^^^
    LINT: stdin:stdin:41+23 - 29: Stray 'html' start tag.

    stdin:stdin:41: [responseBody] =&gt; &lt;html&gt;&lt;title&gt;OAuth Error&lt;/title&gt;

    ^^^^^^^
    LINT: stdin:stdin:41+29 - 36: 'title' element found inside 'body'.

    stdin:stdin:42: &lt;body style='background-color:#edeff2;padding:0;margin:0;font-family:Tahoma;font
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    LINT: stdin:stdin:42+25 - 119: 'body' start tag found but the 'body' element is already open.

    stdin:stdin:48: th03.member.sk1.yahoo.com uncompressed/chunked Fri Jan 22 06:55:34 PST 2010 --&gt;
    ^
    LINT: stdin:stdin:48+119 - 54+8: Non-space character in page trailer.

    stdin:stdin:48: th03.member.sk1.yahoo.com uncompressed/chunked Fri Jan 22 06:55:34 PST 2010 --&gt;
    ^
    LINT: stdin:stdin:48+119 - 54+8: Non-space character after body.

    stdin:stdin:1: &lt;pre&gt;Array
    ^^^^^^^^^^^
    WARNING: stdin:stdin:1+1 - 54+8: folding element html into parent

    stdin:stdin:1: &lt;pre&gt;Array
    ^^^^^^^^^^^
    WARNING: stdin:stdin:1+1 - 41+47: folding element head into parent

    stdin:stdin:41: [responseBody] =&gt; &lt;html&gt;&lt;title&gt;OAuth Error&lt;/title&gt;

    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    WARNING: stdin:stdin:41+29 - 55: removing disallowed tag title

    stdin:stdin:1: &lt;pre&gt;Array
    ^^^^^^^^^^^
    WARNING: stdin:stdin:1+1 - 54+8: folding element body into parent

    stdin:stdin:42: &lt;body style='background-color:#edeff2;padding:0;margin:0
    ^^^^^
    WARNING: stdin:stdin:42+31 - 36: removing attribute style when folding body into parent

    </pre></div>


    Anyone have any thoughts?
    As I solve this one I'll post my resolutions for others to hopefully use one day.
    0
  • So, it came down to the following, if anyone else has this problem and is interested.

    Timestamp issues (resolved 3 times now):
    in yahoo.inc and oauth.php >

    CODEBOX
    time(); //original
    time() + 600 //original
    time() - 600 //original

    time()+3875 //replacement
    time()+3875+600 //replacement
    time()+3875-600 //replacement


    For index.php:

    CODEBOX
    define('OAUTH_DOMAIN', 'http://yahoo.mydomain.com/canvas'); //original

    define('OAUTH_DOMAIN', 'http://yahoo.mydomain.com/canvas/index.php'); //replacement

    /* also changed url in app settings, even though it accepted the original - it didn't match and was incorrect. STUPID LOGIC


    So far, this platform is proving to be the least logical and WORST documented platform I've ever had the mis-fortune to work with.
    0

Recent Posts

in General Discussion at YDN