2011-12-07 14 views
0

libCurlを使用しているC/C++アプリケーションでファイルをアップロードしようとしています(1行のテキストを含む単純なテキストファイル)。FileBoxを使用したDropBoxのアップロードで認証が失敗しました

私が気付いたことがいくつかあります。まず

は...

のDropbox APIは '&' の代わりにしたいように見える 'を?'議論のリストの前に。

セカンド...

リクエストのボディがoauth_signatureの計算に含まれる必要があるかどうかは不明です。

最終的に、DropBox APIから「認証に失敗しました」という応答が返されます。

私は

SSLv3, TLS alert, Client hello (1): 
About to connect() to api-content.dropbox.com port 443 (#0) 
Trying 107.22.243.22... Connected to api-content.dropbox.com (107.22.243.22) port 443 (#0) 
SSLv3, TLS handshake, Client hello (1): 
SSLv3, TLS handshake, Server hello (2): 
SSLv3, TLS handshake, CERT (11): 
SSLv3, TLS handshake, Server key exchange (12): 
SSLv3, TLS handshake, Server finished (14): 
SSLv3, TLS handshake, Client key exchange (16): 
SSLv3, TLS change cipher, Client hello (1): 
SSLv3, TLS handshake, Finished (20): 
SSLv3, TLS change cipher, Client hello (1): 
SSLv3, TLS handshake, Finished (20): 
SSL connection using DHE-RSA-AES256-SHA 
Server certificate: 
subject: C=US; ST=California; L=San Francisco; O=Dropbox, Inc.; OU=IT; CN=*.dropbox.com 
start date: 2010-01-06 00:00:00 GMT 
expire date: 2012-01-06 23:59:59 GMT 
common name: *.dropbox.com (matched) 
issuer: C=ZA; ST=Western Cape; L=Cape Town; O=Thawte Consulting cc; OU=Certification  Services Division; CN=Thawte Premium Server CA; [email protected] 
SSL certificate verify ok. 
PUT   /1/files_put/dropbox/1&file=test%2Etxt&overwrite=true&oauth_consumer_key=asfewasdfas&oauth_nonce=1323293220d0&oauth_signature=asmoa4YE2c%2FuwjDKJRKFILpcn8%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1323293220&oauth_token=fafsesnj13iguxnh&oauth_version=1.0 HTTP/1.1 
Host: api-content.dropbox.com 
Accept: */* 
Content-type: application/json 
Content-Length: 24 
Expect: 100-continue 

HTTP/1.1 100 Continue 
Test upload to DropBox. 
HTTP/1.1 401 Unauthorized 
Server: dbws 
Date: Wed, 07 Dec 2011 21:27:00 GMT 
Content-Type: application/json 
Transfer-Encoding: chunked 
Connection: keep-alive 

22 
{"error": "Authentication failed"} 
0 

答えて

0

HTTP "Authorization" headerを使用してOAuthの"PLAINTEXT"認証モードを使用してみてください...より多くの情報のためのlibcurlからデバッグトレースを用意しました。

PLAINTEXT OAuthはエラーが起こりにくい(標準化やハッシングがないため)

関連する問題