okta-sdk-appauth-android icon indicating copy to clipboard operation
okta-sdk-appauth-android copied to clipboard

cancelIntent does not contain specific cause of error.

Open FeiChen-okta opened this issue 6 years ago • 2 comments

OktaManagementActivity is not forwarding the specific error to applications.

@Override
    protected void onStart() {
        super.onStart();
        OAuthClientConfiguration config = OAuthClientConfiguration.getInstance(this);
        if (config.hasConfigurationChanged()) {
            signOut();
            return;
        }
        // the stored AuthState is incomplete, so check if we are currently receiving the result of
        // the authorization flow from the browser.
        AuthorizationManagementResponse response =
                AuthorizationManagementResponse.fromIntent(getIntent());
        AuthorizationException ex = AuthorizationException.fromIntent(getIntent());

        if (ex != null || response == null) {
            Log.w(TAG, "Authorization flow failed: " + ex);
            sendPendingIntent(mCancelIntent);
        } else if (isLoginFlow(response)) {
            runLoginFlow((AuthorizationResponse) response, ex);
        } else {
            sendPendingIntent(mCompleteIntent);
        }

    }

cancelIntent should attach the exception so the application can notify the user of the cause of the error.

FeiChen-okta avatar Mar 01 '19 17:03 FeiChen-okta

Any update on this?

JagadeshSeeram avatar Mar 11 '19 13:03 JagadeshSeeram

The callbacks are implemented by using pendingIntents and those can't be modified. So this isn't a simple fix we can put in quickly. We are looking at using onActivityResult and other methods.

FeiChen-okta avatar Mar 14 '19 19:03 FeiChen-okta