Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Dropbox #6427

Closed
cyberduck opened this issue Dec 6, 2011 · 25 comments
Closed

Support Dropbox #6427

cyberduck opened this issue Dec 6, 2011 · 25 comments
Assignees
Labels
dropbox Dropbox Protocol Implementation feature fixed
Milestone

Comments

@cyberduck
Copy link
Collaborator

50478fa created the issue

Fresh install of Dropbox Cyberduck connection profile with Cyberduck version 4.2 correctly asks for Dropbox login credentials first, then the API keys dialogue pane. I enter exactly the App key and App secret copied from my Dropbox account Developer page. Authorisation then fails with an error pane entitled 'Login failed' and in blue and underlined as a hyperlink 'Unauthorized'. The link address is 'unauthorised': not a valid URL.

Has anyone else noticed this behaviour?

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Please post the transcript from the log drawer (⌘-L).

@cyberduck
Copy link
Collaborator Author

50478fa commented

Log drawer shows [some values obfuscated]:

GET /0/token?email=admin%40<Dropbox user email address>&password=<password> HTTP/1.1
Authorization: OAuth oauth_consumer_key="<App key>", oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1323264560", oauth_nonce="-3899957315948300361", oauth_signature="<alphanumeric code>"
Host: api.getdropbox.com:443
Connection: Keep-Alive
User-Agent: Cyberduck/4.2 (Darwin/11.2.0) (universal)
HTTP/1.1 401 Unauthorized
Server: nginx
Date: Wed, 07 Dec 2011 13:24:37 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive

@cyberduck
Copy link
Collaborator Author

@dkocher commented

I don't see an error in the request other than the credentials might be wrong. Can you contact Dropbox Support for investigation of the authentiation failure on their side.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

#6418 closed as duplicate.

@cyberduck
Copy link
Collaborator Author

50478fa commented

Replying to [comment:3 dkocher]:

I don't see an error in the request other than the credentials might be wrong. Can you contact Dropbox Support for investigation of the authentiation failure on their side.

No go with Dropbox Support. Decision: leave Dropbox and use other services for now.

@cyberduck
Copy link
Collaborator Author

Laureen Jandroep commented

I am getting the same loop. Fresh install on a macbook pro. Triple checked creds.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

#6670 closed as duplicate.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

#6551 closed as duplicate.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

I can replicate this issue.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

#6660 closed as duplicate.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

#6684 closed as duplicate.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

We have removed support for Dropbox in 6a1053a.

@cyberduck
Copy link
Collaborator Author

f6f8d35 commented

Hi,

Finally I was able to get API 1 support. Dropbox support was recovered.

  1. patch the following to 8ae975d (You will need to apply http://trac.cyberduck.ch/ticket/6768 workaround too).
Index: source/ch/cyberduck/core/dropbox/client/AbstractHttpDropboxClient.java
===================================================================
--- source/ch/cyberduck/core/dropbox/client/AbstractHttpDropboxClient.java	(revision 9660)
+++ source/ch/cyberduck/core/dropbox/client/AbstractHttpDropboxClient.java	(working copy)
@@ -73,7 +73,7 @@
     /**
      - This is set by Dropbox to indicate what version of the API you are using.
      -/
-    protected static final int API_VERSION = 0;
+    protected static final int API_VERSION = 1;
 
     /**
      -
@@ -111,7 +111,8 @@
      - @throws IOException
      - @throws OAuthException
      -/
-    public void authenticate(String key, String secret, String username, String password) throws IOException {
+    public void authenticate(String key, String secret, String token_key, String token_secret) throws IOException {
+/*
         String[] params = {"email", username, "password", password};
 
         OAuthConsumer consumer = new CommonsHttpOAuthConsumer(key, secret);
@@ -133,7 +134,7 @@
             log.info(String.format("Obtained Token Key:%s", token_key));
             log.info(String.format("Obtained Token Secret:%s", token_secret));
         }
-
+*/
         auth = new Authenticator(key, secret,
                 this.getRequestPath("/oauth/request_token"), this.getRequestPath("/oauth/access_token"), this.getRequestPath("/oauth/authorize"),
                 token_key, token_secret);
  1. Use this small script to obtain Access Token.
    https://www.dropbox.com/s/mj92ccgvwoit746/oauth_oob.pl

  2. Input the access token and secret as email and password, then consumer key and secret as "API Key".

PS. I attach OSX binary (patched 8ae975d) (due to Xcode issue, only 10.7+ are supported)
https://www.dropbox.com/s/oi5vblroi7vt19f/Cyberduck.app.zip

@cyberduck
Copy link
Collaborator Author

82f2515 commented

Replying to [comment:15 みらい そらの]:

I am having the same issue on 10.7.5, even with the patched binary provided this morning. The provided script https://www.dropbox.com/s/mj92ccgvwoit746/oauth_oob.pl fails with this error:


Can't locate Data/Random.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at /Volumes/Untitled 1/Users/Shared/Dropbox/Backups/Documents/Temp Storage/oauth_oob.pl line 5.

I entered a random string into the script manually, but then it gave the same error for oauth.pm.

log output:

GET /1/metadata/dropbox/?list=true HTTP/1.1
Authorization: OAuth oauth_consumer_key="[munged]", oauth_nonce="-1221737622392253864", oauth_signature="[munged]", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1369025247", oauth_token="[munged]", oauth_version="1.0"
Host: api.getdropbox.com:443
Connection: Keep-Alive
User-Agent: Cyberduck/4.2.2 (Mac OS X/10.7.5) (i386)
HTTP/1.1 401 Unauthorized
Server: nginx
Date: Mon, 20 May 2013 04:47:28 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
set-cookie: locale=en; expires=Sat, 19 May 2018 04:47:28 GMT; Path=/
pragma: no-cache
cache-control: no-cache
x-dropbox-http-protocol: None
x-frame-options: SAMEORIGIN

I've changed the webpage at
http://trac.cyberduck.ch/wiki/help/en/howto/dropbox so that the words "this page is defunct" are much more noticeable. I read the whole page 3 times over the last 2 hours without noticing it until just now.

@cyberduck
Copy link
Collaborator Author

f6f8d35 commented

Replying to [comment:16 acksyn]:

Can't locate Data/Random.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at /Volumes/Untitled 1/Users/Shared/Dropbox/Backups/Documents/Temp Storage/oauth_oob.pl line 5.

You need to: cpan Data::Random Net::OAuth

Currently, due to Cyberduck's authenticate workflow fault, you need to input access token manually.

It seems there was /token endpoint which directly accepts email and password directly, but it has been removed. So browser-based OAuth must be used.

https://www.dropbox.com/s/mj92ccgvwoit746/oauth_oob.cgi is a CGI version, but you will need to prepare a web server with Net::OAuth...

Off topic: I have modified my fullname in personal preferences, but it isn't reflected.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Will reevaluate support for next major milestone.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:14 みらい そらの]:

Thanks for the patch. Looks like we have to redo the OAuth exchange.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

We have dropped support for Dropbox until we add support again with the new API available.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

We have no immediate plans to bring back support.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

#8879 closed as duplicate.

@cyberduck
Copy link
Collaborator Author

f6f8d35 commented

Sigh... I have changed core.jar to use dropboxapi.com rather than getdropbox.com. (You can find the three parts using grep easily)
And now my special Cyberduck's Dropbox support is recovered.

I have also updated the Cyberduck.app.zip.
Note that you need to delete current bookmark and reenter the account because of hostname update.

Remember, as described in https://trac.cyberduck.io/wiki/help/ja/howto/dropbox , token/secret (here, not email/password) in first box, consumer_key/secret in second box.

Well, now I could understand you, since this patch still depends on OAuth1, which is now deprecated...

@cyberduck
Copy link
Collaborator Author

f6f8d35 commented

By the way, since my machine is now Yosemite, I cannot build objc part of Cyberduck anymore.
I can still build the Java part, but building is getting harder and harder.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

We should evaluate this again with Dropbox API v2 now available.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

In pull request 435.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Milestone renamed

@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dropbox Dropbox Protocol Implementation feature fixed
Projects
None yet
Development

No branches or pull requests

2 participants