Skip to content

Commit

Permalink
[android][oauth2] add more descriptive description to invalid_key errors
Browse files Browse the repository at this point in the history
Summary:
This is the android sdk side of D340841.

The hope is that developers will be able to take the key they passed
in and past it into their application, thus skipping the necessity of
having keytool and openssl. It also reduces frustration.

Test Plan:
This requires a change to our sdk :-/, which currently dosn't show error
descriptions. Anyone
know how I can push a change to the git repo?

We start with non-useful error message. After applying this and the sdk change,
we get the
message
https://our.intern.facebook.com/intern/pixelcloud/image.php?id=31789

after pasting in our key from the message, sso succeeds
https://our.intern.facebook.com/intern/pixelcloud/image.php?id=31787

Reviewers: yariv, jimbru, ahimel, brent, lshepard

Reviewed By: jimbru

CC: platform-diffs@lists, ptarjan, naitik, rhe, jimbru, yariv, lshepard

Differential Revision: 341355

Revert Plan: ok

Platform Impact (PUBLIC):
Android SSO invalid_key failures will now contain the key that
developers attempted to use.  If this key were to be copied directly
into the application settings, SSO will work properly for this
application. This makes it so that developers never have to mess
around with keytool/openssl. They can just attempt a request with a
dummy string, then use the error string returned by our endpoint.
  • Loading branch information
Ray He committed Oct 10, 2011
1 parent 2b80bcf commit f4b2b9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions facebook/src/com/facebook/android/Facebook.java
Expand Up @@ -366,9 +366,13 @@ public void authorizeCallback(int requestCode, int resultCode, Intent data) {
Log.d("Facebook-authorize", "Login canceled by user.");
mAuthDialogListener.onCancel();
} else {
Log.d("Facebook-authorize", "Login failed: " + error);
String description = data.getStringExtra("error_description");
if (description != null) {
error = error + ":" + description;
}
Log.d("Facebook-authorize", "Login failed: " + error);
mAuthDialogListener.onFacebookError(
new FacebookError(error));
new FacebookError(error));
}

// No errors.
Expand Down

0 comments on commit f4b2b9e

Please sign in to comment.