I don't have a 401 anymore but i recieve a "you are being redirected"
page, so i can't get my request_token
here is my code :

function getSignature() {
    var accessor = { consumerSecret: consumer_secret,
        tokenSecret: oauth_token_secret
    };
    var message = { method: "POST",
        action: "/request_token",
        parameters: []
    };
    message.parameters.push(["oauth_callback",
OAuth.formEncode(oauth_callback)]);
    message.parameters.push(["oauth_consumer_key",
OAuth.formEncode(consumer_key)]);
    message.parameters.push(["oauth_nonce", OAuth.nonce(32)]);
    message.parameters.push(["oauth_signature_method",
signature_method]);
    message.parameters.push(["oauth_timestamp", OAuth.timestamp()]);
    OAuth.completeRequest(message, accessor);
    OAuth.SignatureMethod.sign(message, accessor);
    console.log(OAuth.getParameter(message.parameters,
"oauth_signature"));
    var data = "Oauth oauth_consumer_key="+consumer_key
+"&oauth_signature_method="+signature_method
+"&oauth_callback="+OAuth.getParameter(message.parameters,
"oauth_callback")
        +"&oauth_timestamp="+OAuth.getParameter(message.parameters,
"oauth_timestamp")
+"&oauth_nonce="+OAuth.getParameter(message.parameters, "oauth_nonce")
+"&oauth_signature="+OAuth.getParameter(message.parameters,
"oauth_signature");
    console.log(data);
    request_maker = new XMLHttpRequest();
    request_maker.open("POST", "https://api.twitter.com/oauth";);
    request_maker.setRequestHeader("Authorization", data);
    request_maker.onreadystatechange = oth_func;
    request_maker.send("Authorization OAuth" + data);
}

I don't now if it's me being dumb or anything else, but i really can't
find my mistake.

-- 
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: 
http://groups.google.com/group/twitter-development-talk

Reply via email to