Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8586019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:12:30+00:00 2026-06-11T22:12:30+00:00

I am having trouble with OAuthorization, I have a flash player application requesting a

  • 0

I am having trouble with OAuthorization, I have a flash player application requesting a PHP script.
The PHP is always returning:

{"status":false,"message":"Invalid Signature"}

I tried two differents libraries:

https://github.com/yahoo/yos-social-as3
https://github.com/iotashan/oauth-as3

I dont know what do try anymore, could someone help me with this?

The as3 script that is generating a wrong URL:

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);
}

I have a example did in PHP script that generate a correct URL:

<?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->sign_request($sig_method, $consumer, null); //note: double entry of token
    echo $req->to_url();
    exit;
}

This is the url generated by the PHP script, this work:

http://mySite.com/index.php?
oauth_consumer_key=myKey&
oauth_nonce=20de438daf761115018b3d6f26456a6e&
oauth_signature=JpWrfU77Pl%2FfFoa%2BhVy8agq9I5Q%3D&
oauth_signature_method=HMAC-SHA1&
oauth_timestamp=1347583047&
oauth_version=1.0

This is the url generated by the AS3 script, this not work:

http://mySite.com/index.php?
oauth_consumer_key=myKey&
oauth_nonce=b8808c76e9aaa264964aefabb22bdc55&
oauth_signature=jZ31R4C0Ybj1dluIjy6wKCtN7D4%3D&
oauth_signature_method=HMAC-SHA1&
oauth_timestamp=1348705359&
oauth_version=1.0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:12:32+00:00Added an answer on June 11, 2026 at 10:12 pm

    Solved 🙂

    Thanks to PeeHaa that told I was using a version 2.0 library, now I am using back the iotashan lib, that is version 1.0 and it is working now 🙂

    import org.iotashan.oauth.IOAuthSignatureMethod;
    import org.iotashan.oauth.OAuthConsumer;
    import org.iotashan.oauth.OAuthRequest;
    import org.iotashan.oauth.OAuthSignatureMethod_HMAC_SHA1;
    import org.iotashan.oauth.OAuthToken;
    import org.iotashan.utils.OAuthUtil;
    import org.iotashan.utils.URLEncoding;
    
    var signature:IOAuthSignatureMethod = new OAuthSignatureMethod_HMAC_SHA1();
    
    var consumer:OAuthConsumer = new OAuthConsumer("myKey", "mySecret");
    
    var oauthRequest:OAuthRequest = 
        new OAuthRequest(
            OAuthRequest.HTTP_METHOD_GET, 
            "http://mySite.com/index.php",
            null, 
            consumer, 
            null
        );
    
    var request:URLRequest = new URLRequest(oauthRequest.buildRequest(signature, OAuthRequest.RESULT_TYPE_URL_STRING));
    
    // Creating URLLoader to invoke Google service
    var loader:URLLoader = new URLLoader;
    loader.addEventListener(Event.COMPLETE, getComplete);
    loader.load(request);
    
    trace("request", request.url);
    
    function getComplete(event:Event):void
    {
        trace("data", URLLoader(event.currentTarget).data);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having a little trouble with running a php script in the background. I
Having Trouble with Entity Framework. I have been populating EntityReferences with an EntityKey inorder
Having trouble rewriting the name of a flash file: /flash/shell.1257347618.swf (the numbers are a
Having trouble with some select statements. I have 2 tables. sms_log and sms_messages. sms_log
I'm having a lot of trouble getting a simple true/false to evaluate properly in
I'm having a spot of trouble with ASP.NET 4.0 memberships. I want to have
Having trouble linking the Stomp.framework into an iPhone SDK application. http://code.google.com/p/stompframework/ I follow the
Having trouble figuring this one out.. I currently have a frmMain and a frmLoading..
Having trouble getting a form using PHP, JQuery Form plugin, and JQuery Validate plugin
I am having trouble trying to secure ELMAH. I have followed Phil Haacked's tutorial

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.