Skip to content

Commit 0050b46

Browse files
committed
Merge branch 'AuthCodeFlowInvalidSecret' into isVisible
2 parents c9a3ca3 + a321a69 commit 0050b46

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

android/src/main/java/io/fullstack/oauth/OAuthManagerFragmentController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ protected OAuth2AccessToken doInBackground(Void... params) {
375375
} catch (OAuth2AccessTokenErrorResponse ex)
376376
{
377377
Log.e(TAG, "Failed to extract access token: " + ex.getMessage());
378+
mCtrl.onError(-1, ex.getMessage(), "Failed to extract access token.");
378379
return null;
379380
} catch (IOException ex) {
380381
Log.e(TAG, "An exception occurred getRequestToken: " + ex.getMessage());

android/src/main/java/io/fullstack/oauth/OAuthManagerModule.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@ public void onRequestTokenError(final Exception ex) {
120120
Log.e(TAG, "Exception with request token: " + ex.getMessage());
121121
_credentialsStore.delete(providerName);
122122
_credentialsStore.commit();
123+
124+
WritableMap error = Arguments.createMap();
125+
error.putString("message", ex.getMessage());
126+
127+
// In an invalid client situation we will get two errors, first for the invalid client, and second for the null access token
128+
// we really want to report the invalid client error because it provides better feedback
129+
try {
130+
callback.invoke(error);
131+
} catch (Exception e2)
132+
{
133+
Log.e(TAG, "exception with request: callback failed: " + e2.getMessage() );
134+
}
123135
}
124136
public void onOAuth1AccessToken(final OAuth1AccessToken accessToken) {
125137
_credentialsStore.store(providerName, accessToken);

0 commit comments

Comments
 (0)