401 error at request_token using out of band callback


Hi all.

I am currently developping a desktop application. The OAuth part is based on the tweetsharp library.

I reach to get a request with the following header :

OAuth oauth_callback="oob", 

But it gets a 401 error. It may be related to the signature construction so here is the code for it :

            var sigBaseString = method + "&" + Globals.ProperUrlEscape(baseAddress) + "&" + Globals.ProperUrlEscape(string.Format(parameters, consumerKey, nonce, oAuthSignatureMethod, timestamp));

            string oAuthSignature;

            using (var sha = new HMACSHA1(Encoding.ASCII.GetBytes(consumerSecret + "&")))
                oAuthSignature = Convert.ToBase64String(sha.ComputeHash(Encoding.ASCII.GetBytes(sigBaseString)));

any help ?


What format is that timestamp in? You’ll need to use a Unix timestamp, not whatever stardate that’s supposed to be :slight_smile:

When generating the base string, make sure to include all parameters, including query string parameters, and all oauth_* parameters (excepting oauth_signature). I don’t see oauth_version or oauth_callback being used in your base string, for example.

If you get a specific error message in addition to the 401, posting that will help debug.