2009-12-30 8 views
0

J'ai écrit un client Twitter pour les gadgets de bureau Win7 (html + JavaScript). J'essaye de me convertir à OAuth mais je ne peux même pas "démarrer" pour ainsi dire. J'utilise la librairie Javascript suggérée par Twitter.Twitter jeton de demande OAuth en JavaScript

Voici la demande que j'envoie et la réponse 401. Quelqu'un peut-il repérer le problème. Je suis perplexe.

GET /oauth/request_token HTTP/1.1 
x-requested-with: XMLHttpRequesst 
Accept-Language: en-us 
Authorization: OAuth realm="http%3A%2F%2Ftwitter.com",oauth_consumer_key="tHupzQvYhbIknowkcQZCBw",oauth_version= "1.0",oauth_timestamp="1262185882",oauth_nonce="xBkBJc",oauth_signature_method="HMAC-SHA1",oauth_signature="Gec%2F%2B7QemcnEUTnkDHAIXI7wA5k%3D" 
Accept: text/plain, */* 
Accept-Encoding: gzip, deflate 
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E) 
Host: twitter.com 
Connection: Keep-Alive 
Cookie: _twitter_sess=BAh7CDoRdHJhbnNfcHJvbXB0MDoHaWQiJTlmMWZhOTNhM2I3ZTgzOGMxMGZi%250AN2VkZGM2NzgzYzY1IgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpGbGFz%250AaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--0d82a56e2666db16b4b19c5a7a2e50bedfdacadb 


HTTP/1.0 401 Unauthorized 
Date: Wed, 30 Dec 2009 15:11:25 GMT 
Server: hi 
X-Transaction: 1262185885-20125-10018 
Status: 401 Unauthorized 
Last-Modified: Wed, 30 Dec 2009 15:11:25 GMT 
X-Runtime: 0.01220 
Content-Type: text/html; charset=utf-8 
Pragma: no-cache 
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0 
Expires: Tue, 31 Mar 1981 05:00:00 GMT 
X-Revision: DEV 
Set-Cookie: _twitter_sess=BAh7CDoRdHJhbnNfcHJvbXB0MCIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxl%250Acjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoHaWQiJTlmMWZhOTNh%250AM2I3ZTgzOGMxMGZiN2VkZGM2NzgzYzY1--b3e8e63eaa02e1ac989f58ee87bacc67b1d72847; domain=.twitter.com; path=/ 
Vary: Accept-Encoding 
Content-Length: 44 
Connection: close 

Failed to validate oauth signature and token 

Des pensées?

Répondre

1

Et la réponse est: j'ai oublié d'utiliser le consumerSecret lors de la signature. Soupir ...

0

Je ne suis pas sûr à ce sujet .. mais devrait envoyer un jeton oauth dans votre demande, l'envoyez-vous?

Questions connexes