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

AuthException/CustomTabsNotSupportedException when default browser does not support custom tabs #1830

Closed
andiigtayma opened this issue Jun 28, 2022 · 10 comments
Labels
Android Issues specific to the Android Platform auth Issues related to the Auth Category bug Something is not working; the issue has reproducible steps and has been reproduced fixed-in-release-candidate Issues that have been addressed in the current release-candidate branch

Comments

@andiigtayma
Copy link

andiigtayma commented Jun 28, 2022

We're using Amplify Auth with Google as the provider.
It has been working just fine for all our users however, for one it fails and logs in this message:
AuthException(message: Sign-in with web UI failed, recoverySuggestion: See attached exception for more details, underlyingException: com.amazonaws.mobileconnectors.cognitoauth.exceptions.CustomTabsNotSupportedException: Browser with custom tabs support not found.)

Device: Oppo, Android 11

So far, we've tried to modify the manifest to support this device with this:

<queries>
        <intent>
          <action android:name="android.intent.action.VIEW" />
          <category android:name="android.intent.category.BROWSABLE" />
          <data android:scheme="https" />
        </intent>
        <intent>
            <action android:name=
                "android.support.customtabs.action.CustomTabsService" />
        </intent>
 </queries>

Other things we've tried:

  1. Cleared chrome browser cache
  2. Updated browser to latest version

Using Plugins:

  amplify_auth_cognito: ^0.2.2
  amplify_flutter: ^0.2.2
  google_sign_in: ^5.0.7
@ragingsquirrel3 ragingsquirrel3 added auth Issues related to the Auth Category question A question about the Amplify Flutter libraries Android Issues specific to the Android Platform labels Jun 28, 2022
@ragingsquirrel3
Copy link
Contributor

@andiigtayma there is some discussion of similar issue on #863 which points to aws-amplify/amplify-android#678 (comment) so you can see if the installed browsers support custom tabs.

@Jordan-Nelson
Copy link
Member

@andiigtayma - Just to confirm, the device has Chrome installed? Can you check what browser is set as the default on the device (listed in settings)?

@andiigtayma
Copy link
Author

@Jordan-Nelson this worked!
Set the browser to default and the user was able to login.

@Jordan-Nelson
Copy link
Member

Jordan-Nelson commented Jun 29, 2022

Okay. I am actually going to re-open this and mark it as a bug. We should be able to handle the case when a supported browser is installed, but not set to the default.

Do you know what browser was set as the default when it was not working?

@Jordan-Nelson Jordan-Nelson reopened this Jun 29, 2022
@Jordan-Nelson Jordan-Nelson changed the title Browser with custom tabs support not found Browser with custom tabs support not found when default browser does not support custom tabs Jun 29, 2022
@Jordan-Nelson Jordan-Nelson added bug Something is not working; the issue has reproducible steps and has been reproduced and removed question A question about the Amplify Flutter libraries labels Jun 29, 2022
@andiigtayma
Copy link
Author

@Jordan-Nelson We had no idea about how the user may have set up their phone.

Before the issue was reported to us, we looked into the logs and found
AuthException(message: Sign-in with web UI failed, recoverySuggestion: See attached exception for more details, underlyingException: com.amazonaws.mobileconnectors.cognitoauth.exceptions.BrowserNotInstalledException: No browsers installed.

The user confirmed that they had Google Chrome installed and we asked them to clear cache/ update.

Then we added the https intent query into the manifest and gave the user a new build. This changed the error to AuthException(message: Sign-in with web UI failed, recoverySuggestion: See attached exception for more details, underlyingException: com.amazonaws.mobileconnectors.cognitoauth.exceptions.CustomTabsNotSupportedException: Browser with custom tabs support not found.)

@Jordan-Nelson Jordan-Nelson changed the title Browser with custom tabs support not found when default browser does not support custom tabs AuthException/CustomTabsNotSupportedException when default browser does not support custom tabs Jun 30, 2022
@dnys1
Copy link
Contributor

dnys1 commented Jul 26, 2022

Hi @andiigtayma, I noticed you may be on older versions of the Amplify Flutter libraries. There have been significant improvements made recently, and I wonder if you'd willing to try out the latest version (^0.6.0) to see if the issue still persists.

@andiigtayma
Copy link
Author

Hello @dnys1, I have a Samsung with Android 12. The default browser is Chrome, and since the issue was due to not having a default browser setup, I tried this:

  1. if I disable Chrome and debug the app, I get:
    AuthException(message: Failed to sign out, recoverySuggestion: See attached exception for more details, underlyingException: com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthServiceException: Timed out while waiting for sign-out redirect response.)

  2. If I download a different browser, it automatically switches default system browser to the available option.

So, I don't think I would be able to test this unless I know a way to have Chrome on device and not have a default browser.
Oh and I did try this with updated amplify plugins.

@dnys1
Copy link
Contributor

dnys1 commented Jul 27, 2022

In both of those cases, that is the correct behavior, though. If you disable Chrome and have no other browsers, the request should fail. And if you have installed other browsers and made those default, that is what will be chosen.

You say you added the queries intent filter only after your user experienced the CustomTabsNotSupportedException? This is required as of Android 11 and could alone be the cause of the exception. Has your user been able to reproduce the issue since adding that filter and upgrading the Amplify libraries?

@Jordan-Nelson
Copy link
Member

For anyone facing this issue, this has been addressed in the latest dev-preview release of Auth (amplify_flutter v1.0.0-next.0). This new version is a full re-write of the auth category in dart, and it supports Mobile, Desktop, and Web.

You can read more about the developer preview release in the blog post and docs. I will update this issue again once this new version is out of developer preview.

@Jordan-Nelson Jordan-Nelson added the pending-release Issues that have been addressed in main but have not been released label Aug 2, 2022
@Jordan-Nelson Jordan-Nelson added fixed-in-release-candidate Issues that have been addressed in the current release-candidate branch and removed pending-release Issues that have been addressed in main but have not been released labels Mar 2, 2023
@Jordan-Nelson
Copy link
Member

This issue has been addressed in v1.0.0 of Amplify Flutter, which is now stable. This release also includes web and desktop support for Auth, API, Analytics, and Storage. You can see the list of new features and bug fixes in the release notes, and see more details on how to migrate in the upgrade guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issues specific to the Android Platform auth Issues related to the Auth Category bug Something is not working; the issue has reproducible steps and has been reproduced fixed-in-release-candidate Issues that have been addressed in the current release-candidate branch
Projects
None yet
Development

No branches or pull requests

4 participants