2014-02-19 130 views
0

WTF! 使用應用程序唯一身份驗證構建Adobe AIR twitter搜索設備。
https://dev.twitter.com/docs/auth/application-only-auth

我可以正確得到我的承載令牌,但所有請求導致Twitter請求返回「消息」:「無效或過期的令牌」,「代碼」:89那麼它是無效還是過期?

HTTP/1.1 401 Unauthorized 
content-encoding: gzip 
content-length: 86 
content-type: application/json; charset=utf-8 
date: Wed, 19 Feb 2014 16:08:13 UTC 
server: tfe 
strict-transport-security: max-age=631138519 

{"errors":[{"message":"Invalid or expired token","code":89}]} 

那麼,究竟是什麼,無效或過期?

我注意到,在我的持票人標記的響應標題中有一個值爲Tue的'expires'標題,1981年3月31日05:00:00 GMT 這是否適用於持票人標記本身?

這些模棱兩可的錯誤消息正在給我(我敢肯定很多其他開發人員)GRIEF TONS!

當我們收到這個消息時,我們如何調試與持票人令牌的請求?

請幫忙......任何人!!!!!!!在奧阿斯地獄!

回答

0

您是否卡在https://dev.twitter.com/docs/auth/application-only-auth的過程的第3步?

另請參見常見錯誤情況,似乎您的令牌無效。

如需進一步的幫助,我們建議您使用https://dev.twitter.com/discussions來發布您的問題,我們很少來這裏,但每天都會在我們的開發者網站上監控問題。

+0

是第3步,發佈在twitter討論區,但更多的流量在這裏,我的整個RAW請求高於 –

+0

https://dev.twitter.com/discussions/26260 –

+0

常見錯誤案例:使用不正確的或撤銷的不記名令牌。精細。所以現在我必須確定它是不正確的還是撤銷的。在base64編碼之前或之後,必須有更好的方法來檢查承載令牌的有效性!我爲我的授權標題完成的所有操作都是「授權」,「承載」+ 。 –

0
GET /1.1/search/tweets.json?q=sochi HTTP/1.1 
Host: api.twitter.com 
Accept-Language: en-us 
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/533.19.4 (KHTML, like Gecko) AdobeAIR/3.9 
Accept: */* 
Referer: app:/TweetMasher700.swf 
Content-Type: application/x-www-form-urlencoded;charset=UTF-8 
Connection: keep-alive 
x-flash-version: 11,9,900,117 
Cookie: xxxxxxxxxxxxxxxxxxxxx 
Authorization: Bearer xxxxxxxx== 
Proxy-Connection: keep-alive 
Accept-Encoding: gzip, deflate 
0

我有同樣的問題,我是能夠解決的問題,這樣做:

consumer_key = "put here your API key" 
consumer_secret = "put here your API secret" 

access_token = "put here your access token" ##remember to put the "-" that separete your owener ID and your token 
access_token_secret = "put here your token secret" 

auth = twitter.oauth.OAuth(access_token, access_token_secret, consumer_key, consumer_secret) 

非常重要的,獨立於令牌訪問和secreat消費者密鑰和密碼,監守很多人混合授權和訪問令牌,使twitter plataform拒絕您的訪問。

相關問題