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

  • Home
  • SEARCH
  • 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 6994841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:56:37+00:00 2026-05-27T19:56:37+00:00

HELP ! I’m trying to upgrade may program to support the new oAuth that

  • 0

HELP !
I’m trying to upgrade may program to support the new oAuth that Google uses in the AdWords.
Using my website I’m able to create an accessToken and an accessTokenSecret for my users and store it in my database.

My problem is when I try to make a soap request later with those credentials.

  • Which information do I need to save from the website part? so far I save only the accessToken and the accessTokenSecret. is there anything else?
  • How do I use the accessToken, accessTokenSecret and what ever else I’ve saved in order to make a SOAP requests? (please be as “low level” as you can, “just use them in the request header” won’t help me).

Some info on my process:

  • Not using the Client Library from Google (too much over head, and so far I didn’t needed them).
  • Using the auto-generated SOAP code using VS2005 WSDL on the services I’m using.
  • C# code.

Any help would be highly appreciated.
Thanks!

=======================================================================================
As advised, I have extend the GetWebRequest in the following way:

protected override WebRequest GetWebRequest(Uri uri)
        {
            WebRequest request = base.GetWebRequest(uri);

            String token = "XXXXXXXXXXX";//a valid token - changed for here.
            String secret = "XXXXXXXXXXXX";//a valid secret - changed for here.
            String consumerKey = "anonymous";
            String consumerSecret = "anonymous";
            String sigMet = "HMAC-SHA1";
            String oauth_timestamp = ((DateTime.UtcNow.Ticks - new DateTime(1970, 1, 1).Ticks) / (1000 * 10000)).ToString();
            String oauth_nonce = Guid.NewGuid().ToString();

            Parameter[] paramArray = new Parameter[]{
                                        new Parameter("oauth_consumer_key", consumerKey),
                                        new Parameter("oauth_token", token),
                                        new Parameter ("oauth_signature_method", sigMet),
                                        new Parameter ("oauth_timestamp", oauth_timestamp),
                                        new Parameter ("oauth_nonce", oauth_nonce)
                                        };

            String oauth_signature = CreateHMACSHA1Signature(
                                        request.Method,
                                        uri,
                                        paramArray,
                                        consumerSecret,
                                        secret
                                        );

            request.Headers.Add(
                            "Authorization: OAuth " +
                            "realm=\"" + "https://www.google.com/" + "\"," +
                            "oauth_consumer_key=\"" + Parameter.EncodeParameterString(consumerKey) + "\"," +
                            "oauth_token=\"" + Parameter.EncodeParameterString(token) + "\"," +
                            "oauth_signature_method=\"" + Parameter.EncodeParameterString(sigMet) + "\"," +
                            "oauth_signature=\"" + Parameter.EncodeParameterString(oauth_signature) + "\"," +
                            "oauth_timestamp=\"" + Parameter.EncodeParameterString(oauth_timestamp) + "\"," +
                            "oauth_nonce=\"" + Parameter.EncodeParameterString(oauth_nonce) + "\""
                        );

            return request;
        }

the function CreateHMACSHA1Signature is the same one used to with OAuthGetRequestToken and OAuthAuthorizeToken just fine. but when used with the SOAP I’m getting the following error:
System.Web.Services.Protocols.SoapException: AuthenticationError.OAUTH_TOKEN_HEADER_INVALID @ Service[ServicedAccountService.get]

Any idea why it is?

  • 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-05-27T19:56:38+00:00Added an answer on May 27, 2026 at 7:56 pm

    SUCCESS !!!

    I finely found what was wrong, and it was only by a chance.
    when creating the signature I’ve used the request.method for the method parameter.
    The problem with this is that at this moment the method is “GET” but the SOAP mechanisim will change it to “POST” (so it can pass the SOAP parameters) this cause my signature to not work.

    the only fix I needed to do is change:

    String oauth_signature = CreateHMACSHA1Signature(
        request.Method,
        ...
        )
    

    to:

    String oauth_signature = CreateHMACSHA1Signature(
        "POST",
        ...
        )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Help, I'm trying to create a new post in my wordpress blog with custom
Help! I have two objects that i have created using different techniques in django;
Help Help! Google indexed a test folder on my website which no one save
Help! I'm getting this error when trying to connect using JAX-WS webservice call: java.lang.NoClassDefFoundError:
Help! I have an Axis web service that is being consumed by a C#
Help! I am using jQuery to make an AJAX call to fill in a
Help! I have a PHP (PHP 5.2.5) script on HOST1 trying to connect to
help me to manage IIS (what i am trying to do is create virtual
HELP! I just setup a virtual host for two sites that have a lot
Help me settle an argument here. Is this: SqlCommand cmd = new SqlCommand( sql

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.