Note that there are some explanatory texts on larger screens.

plurals
  1. POOAuth invalid signature
    primarykey
    data
    text
    <p>I am having trouble with OAuthorization, I have a flash player application requesting a PHP script. The PHP is always returning:</p> <pre><code>{"status":false,"message":"Invalid Signature"} </code></pre> <p>I tried two differents libraries:</p> <pre><code>https://github.com/yahoo/yos-social-as3 https://github.com/iotashan/oauth-as3 </code></pre> <p>I dont know what do try anymore, could someone help me with this?</p> <p>The as3 script that is generating a wrong URL:</p> <pre><code>import com.yahoo.oauth.OAuthRequest; import com.yahoo.oauth.OAuthConsumer; import com.yahoo.oauth.OAuthSignatureMethod_HMAC_SHA1; import com.yahoo.oauth.IOAuthSignatureMethod; import com.yahoo.oauth.OAuthToken; import com.yahoo.oauth.OAuthUtil; var signature:IOAuthSignatureMethod = new OAuthSignatureMethod_HMAC_SHA1(); var consumer:OAuthConsumer = new OAuthConsumer("myKey", "mySecret"); var oauthRequest:OAuthRequest = new OAuthRequest( "GET", "http://mySite.com/index.php", null, consumer, null ); var request:URLRequest = new URLRequest(oauthRequest.buildRequest(signature)); var loader:URLLoader = new URLLoader; loader.addEventListener(Event.COMPLETE, getComplete); loader.load(request); function getComplete(event:Event):void { trace("data", URLLoader(event.currentTarget).data); } </code></pre> <p>I have a example did in PHP script that generate a correct URL:</p> <pre><code>&lt;?php // include oath require_once('OAuth/OAuth.php'); if ($mode == 'generate') { $consumer = new OAuthConsumer(OAUTHKEY, OAUTHSECRET); $sig_method = new OAuthSignatureMethod_HMAC_SHA1; // call this file $api_endpoint = $_GET['url']; //use oauth lib to sign request $req = OAuthRequest::from_consumer_and_token($consumer, null, 'GET', $api_endpoint, $parameters); $sig_method = new OAuthSignatureMethod_HMAC_SHA1(); $req-&gt;sign_request($sig_method, $consumer, null); //note: double entry of token echo $req-&gt;to_url(); exit; } </code></pre> <p>This is the url generated by the PHP script, this work:</p> <pre><code>http://mySite.com/index.php? oauth_consumer_key=myKey&amp; oauth_nonce=20de438daf761115018b3d6f26456a6e&amp; oauth_signature=JpWrfU77Pl%2FfFoa%2BhVy8agq9I5Q%3D&amp; oauth_signature_method=HMAC-SHA1&amp; oauth_timestamp=1347583047&amp; oauth_version=1.0 </code></pre> <p>This is the url generated by the AS3 script, this not work:</p> <pre><code>http://mySite.com/index.php? oauth_consumer_key=myKey&amp; oauth_nonce=b8808c76e9aaa264964aefabb22bdc55&amp; oauth_signature=jZ31R4C0Ybj1dluIjy6wKCtN7D4%3D&amp; oauth_signature_method=HMAC-SHA1&amp; oauth_timestamp=1348705359&amp; oauth_version=1.0 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload