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

Add workaround for Facebook oauth bug to oauth2 package #12366

Closed
DartBot opened this issue Aug 11, 2013 · 5 comments
Closed

Add workaround for Facebook oauth bug to oauth2 package #12366

DartBot opened this issue Aug 11, 2013 · 5 comments
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Aug 11, 2013

This issue was originally filed by @MaxHorstmann


Facebook's oauth2 implementation has a bug. It returns the access token as plain text (text/plain) instead of json (application/json).

See e.g. http://stackoverflow.com/questions/3862108/facebook-oauth-access-token-missing

Unforunately, this breaks the oauth2 package (http://pub.dartlang.org/packages/oauth2) right here: https://code.google.com/p/dart/codesearch#dart/trunk/dart/pkg/oauth2/lib/src/handle_access_token_response.dart&l=37

Ideally Faceboook should fix this return json like the oauth2 spec says, but well, so far they haven't done so.

Since Facebook sign-in is a fairly common use case, my suggestion is to add some flexibility here and handle both a json or plaintext response. The plaintext response string looks like this:

access_token=CAAC9nzmHiUwBAE36sC6fPvDOtlZAFGfoLEfZAcfS2VnEOyo7ZCvckG55tCvzwRQNuSl2unMpFYxxxxxdostdNU38grYyEVSIUe2MhIWXII0ufc380vUc56B6cYAtli153PKuEZA1BT44AoyrtQTc3UT6meZAiO1YZD&expires=5181866

@DartBot
Copy link
Author

DartBot commented Aug 12, 2013

This comment was originally written by @MaxHorstmann


Here's how I fixed it locally: https://gist.github.com/MaxHorstmann/6207756

@anders-sandholm
Copy link
Contributor

Removed Type-Defect label.
Added Type-Enhancement, Area-Pkg, Triaged labels.

@sethladd
Copy link
Contributor

Added Pkg-OAuth2, AssumedStale labels.

@nex3
Copy link
Member

nex3 commented Jul 17, 2014

Added Triaged label.

@DartBot DartBot added Type-Enhancement area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. labels Jul 17, 2014
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/oauth2#7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants