Skip to content

Logout ignores allowedBrowsers and uses default browser (Firefox) #724

@prabuddaf

Description

@prabuddaf

Checklist

Description

Reproduction Steps: Logout ignores allowedBrowsers and uses default browser (Firefox)
Preconditions

  • Android device has Firefox installed and Google Chrome installed.
  • Set Firefox as the system default browser:
  • Android Settings → Apps → Default apps → Browser app → Firefox
  • In the app’s Auth0 login setup, configure allowedBrowsers to exclude Firefox and allow only Chrome (and/or other non-Firefox browsers).
  • Example intent: allowedBrowsers = [Chrome] (Firefox not included)
  • Ensure the app is configured for Auth0 login/logout normally (callbacks and allowed URLs already set).

I have used allowedBrowsers to restrict firefox browser, adding only other browser list with google chrome.

Issue:

But if user has selected default browser as Firefox, App uses chrome instance to login, but when I press logout it loads the FireFox (Default) in app webview and load 'Not Found' Page. I think logout function does not consider the allowedBrowsers. we might need to add that parameter to there as well I guess.

  Future<Credentials> login() async {
    _logger.d('Logging in with Auth0');
    try {
      final webAuthScheme = Platform.isAndroid ? 'https' : scheme;
      final response = await _auth0.webAuthentication(scheme: webAuthScheme).login(
        scopes: {'openid', 'profile', 'email', 'offline_access'},
        useHTTPS: true,
        allowedBrowsers: Platform.isAndroid
            ? const [
                // Chrome & Chrome Custom Tabs
                'com.android.chrome',
                'com.chrome.beta',
                'com.chrome.dev',
                'com.chrome.canary',

                // Opera
                'com.opera.browser',
                // Samsung Internet
                'com.sec.android.app.sbrowser',
                // Edge
                'com.microsoft.emmx',
                // TCL Browser
                'com.tcl.browser'
                // Zeus Browser
                'com.goodtoolapps.zeus'
                // UC Browser
                'com.UCMobile.intl'
              ]
            : const []
      );
Image

Reproduction

  1. Launch the Android app.
  2. Start the Auth0 Login flow.
  3. Observe that login opens in Chrome (Custom Tab) even though the device default browser is Firefox (expected due to allowedBrowsers).
  4. Complete login successfully and return to the app.
  5. Trigger Logout from within the app (Auth0 logout flow).
  6. Observe which browser/webview is used to perform logout and what page loads.

Additional context

No response

auth0_flutter version

1.14.0

Flutter version

3.35.7

Platform

Android

Platform version(s)

Android 16 (API 36)

Metadata

Metadata

Assignees

Labels

androidbugThis points to a verified bug in the code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions