Hi again !

I'm trying to develop a desktop-application javascript based.
I'm actually trying to get the request_token from twitter.
I'm using OAuth js library, and after testing their examples, i'm
trying to do the same thing as 
do, because it seems to work and twitter respond with a valuable
request_token and secret.
To complete the exactly same request, i've been wiresharking my http
request and form the same strings with XMLHttpRequest in my code.
The only response i get is "401 - failed to validate oauth signature
or token", so i assume i make a mistake in basestring generation or
basstring signature.
my code :
function signForm() {
    accessor = { consumerSecret: consumer_secret
        , tokenSecret   : oauth_token_secret};
    message = { action: "/request_token"
        , method: "POST"
        , parameters: []};
    message.parameters.push(["oauth_consumer_key", consumer_key]);
    OAuth.SignatureMethod.sign(message, accessor);
    return true;

function getSignature() {
    OAuth.completeRequest(message, accessor);
    request_maker = new XMLHttpRequest();
    request_maker.open("POST", "http://api.twitter.com/oauth/
    request_maker.setRequestHeader("Host", "api.twitter.com");
    request_maker.setRequestHeader("Content-type", "application/x-www-
    request_maker.onreadystatechange = oth_func;
+"&oauth_nonce="+OAuth.getParameter(message.parameters, "oauth_nonce")

I've seen some "base64" encoding in some twitter client sources, but
since it's not mentioned in twitter api doc, i don't use base64.

If you have any clue to help me go through this issue, i'd be
gratefull !

Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 

Reply via email to