So i've checked my signature with http://oauth.googlecode.com/svn/code/javascript/example/signature.html and it appears that my basestring and signature are now ok. But i still can't find where is my error when sending my data. I've tried to send it in "authorization" header field, and in body, but nothing has happened, stille the same "failed to validate oauth signature or token"
So i'd be wvery grateful for a little help... On 15 avr, 13:51, galeyte <[email protected]> wrote: > 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
