Skip to content

Support Callback for Dropbox#287

Closed
mvlcek wants to merge 2 commits into
scribejava:masterfrom
mvlcek:master
Closed

Support Callback for Dropbox#287
mvlcek wants to merge 2 commits into
scribejava:masterfrom
mvlcek:master

Conversation

@mvlcek

@mvlcek mvlcek commented Jul 25, 2012

Copy link
Copy Markdown

Dropbox uses the OAuth 1.0 API, not the OAuth Revision A API - the main difference is that the callback URL is passed within the authorization request.

This Patch includes a new DefaultApi10 and a corresponding OAuth10ServiceImpl with above changes vs. the 10a files concerning the callback URL.

The DropboxApi inherits from the DefaultApi10 and includes the callback in the authorization URL.

mvlcek added 2 commits July 25, 2012 22:55
visible difference is that the callback URL is passed within the
authorization request.

This Patch includes a new Api10 and a corresponding OAuth10ServiceImpl
with above change concerning the callback URL.
@fernandezpablo85

Copy link
Copy Markdown
Collaborator

Why is this even needed. I thought scribe worked well with Dropbox :S

@mvlcek

mvlcek commented Jul 26, 2012

Copy link
Copy Markdown
Author

It (repository/not latest release) works well but for the callback to redirect the user to after the authentication.
OAuth 1.0a specifies the callback when getting the request token, but Dropbox ignores this. You have to specify the callback later in the authentication URL otherwise the user will never be redirected.

(see also #203 (comment))

@fernandezpablo85

Copy link
Copy Markdown
Collaborator

And ~300 lines of code for that?

Why can't you just do:

String url = service.getAuthenticationUrl() + "callback=foobar.com";

Or something like that?

@mvlcek

mvlcek commented Jul 26, 2012

Copy link
Copy Markdown
Author

The number of lines is caused by the new DefaultApi10 and OAuth10ServiceImpl, which are modified copies of DefaultApi10a and OAuth10aServiceImpl.
Of course I can just the oauth_callback parameter to the authentication URL (which is exactly what I did first), but this would have to be done by everybody using it (and it needs to be documented). By doing it via a Api10 the user can use Dropbox the same way as the other services (and other 1.0 services out there can also easily use this Api10).

I really like scribe because of the ease of use (with the exception of the callback it just worked!) and thus have modified my copy in the above way to make Dropbox as easy to use as other services. As I usually share my modifications to open source software if they could be useful to others, I decided to create the pull request (which is really easy with GitHub) to let you (as the author of this great library) know.

@fernandezpablo85

Copy link
Copy Markdown
Collaborator

Thanks a lot for the pull request.

In this case, I'd rather have a one line hacky string concatenation on the client than 300 lines of code in the library.

Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants