auth0 / auth0-flutter

Auth0 SDK for Flutter
https://pub.dev/documentation/auth0_flutter/latest/
Apache License 2.0
57 stars 36 forks source link

Firefox users seeing "not found" on Android, both login and logout #392

Open MilesAdamson opened 6 months ago

MilesAdamson commented 6 months ago

Checklist

Description

We have done a release migrating to this plugin. After releasing we are getting a lot of reports of users seeing a webpage which says "not found" on android, for both login and logout. We saw this in development as well, but after registering everything, it never happened again.

These are the steps we did to set it up:

Add product flavors so that each flavor goes to one of our auth0 setups:

    productFlavors {
        dev {
            dimension "default"
            manifestPlaceholders['auth0Domain'] = "redacted"
            manifestPlaceholders['auth0Scheme'] = "https"
        }
        qa {
            dimension "default"
            manifestPlaceholders['auth0Domain'] = "redacted"
            manifestPlaceholders['auth0Scheme'] = "https"
        }
        prod {
            dimension "default"
            manifestPlaceholders['auth0Domain'] = "redacted"
            manifestPlaceholders['auth0Scheme'] = "https"
        }
    }

Added callback URLs in all 3 auth0 setups: image

Added the sha256 signing key to the "key hashes" section of advanced settings. For production, I took this value directly from the google play store releases section. image

Login:

  Future<Credentials> login({String? tenant}) async {
    final credentials = await _webAuth.login(
      audience: _applicationConstants.audience,
      useEphemeralSession: true, // Do not show iOS native dialogs
      parameters: {
        if (tenant != null) "tenant": tenant,
        "prompt": "login", // Ignore the cookie and show the login page
      },
    );

    return credentials;
  }

Before releasing, we were not seeing the "not found" issue anymore on any devices, including a smoke test on production. Now that we have released this build, we are seeing a lot of support issues come up like this one:

Hi, after the update, I could not log in yesterday. I kept getting a web page saying "not found" pop up (attached screen shot). I tried entering the wrong password and it would give me the usual wrong password error message( 2nd attached screen shot). I tried deleting the app and re installing, restarting my phone, confirming my phone was running the most up to date software, and it still would give me the not found message. After about 20 attempts to log in, it did end up working. But now iam having the same issue when logging out of the app. Same not found message and it won't let me log out. I have to delete the app just to log out of the thing, but I won't because I will run into the same problem when trying to log back in.

~So far we haven't been able to reduce the issue~ (see comment, it's firefox)

First is that it only happens to some users. If the android app link wasn't set up properly I would think it would never work for anyone, like it did during development before we fixed it. (our issue during development seen here https://github.com/auth0/auth0-flutter/issues/321 was that the sha256 was not registered in the application)

Then the other thing, they try over and over and eventually it works on the same device. This is also super weird, again I would expect it to either redirect into the app and work always or not at all.

Reproduction

Only happens sometimes, so some users.

Additional context

No response

auth0_flutter version

1.3.1

Flutter version

3.16.3

Platform

Android

Platform version(s)

No response

MilesAdamson commented 6 months ago

Looks like this issue happens when users have firefox as their default browser. Firefox is not opening the app link properly. If I tap the "open in app" button in the options it sends them into the app.

By default installs of firefox seem to have "open links in apps: never". But if I change this to "always" or "ask before opening", it still isn't working. Not clear if this is an issue with firefox or this plugin but if you guys could see if there's anything you could do to make it behave on firefox that would be appreciated.

Cpruce commented 6 months ago

I just ran into this as well. What fixed it was changing 'https' to a custom scheme.

https://community.auth0.com/t/flutter-gives-not-found-instead-of-redirecting-to-app/98929

Widcket commented 6 months ago

@poovamraj could you please take a look?

MilesAdamson commented 6 months ago

I just ran into this as well. What fixed it was changing 'https' to a custom scheme.

https://community.auth0.com/t/flutter-gives-not-found-instead-of-redirecting-to-app/98929

In general, if android app links are not set up, you will see "not found" if using https. The app doesn't know to open the link.

In our case, it does work, except when the user has firefox as their default browser. I will update the title of the issue to be more specific now that we have more info

MilesAdamson commented 5 months ago

Users are also reporting this issue on the default Samsung browser as well

andrecarlucci commented 4 months ago

I'm using the Kiwi browser and I'm getting the same "Not found" error too. It works when I change the default browser of my phone to Chrome.

MilesAdamson commented 3 months ago

@Widcket any updates?

Widcket commented 3 months ago

cc @poovamraj

jinnielazzy commented 1 month ago

commenting for answers

poovamraj commented 1 month ago

Hello, sorry on the late response, the issue can be fixed in two ways.

We will ensure this covered in our documentation to make this clear.

MilesAdamson commented 1 month ago

Hi @poovamraj, we have app links set up. In the issue I have went over what we did to set it up. It is currently working on chrome just fine. However, it is not working on firefox or the samsung default browser. It is my understand that if we set up the app links incorrectly, it would not work on any browser.

Do you have an explanation on why it would work on chrome but not some other browsers?

MilesAdamson commented 2 weeks ago

@poovamraj based on your response, it appears your did not even read the issue and comments here completely. And it has been another month without a new comment

@Widcket is this the level of support we should expect for this plugin? If so we will consider alternatives

Widcket commented 2 weeks ago

Hi @MilesAdamson, please note I'm no longer the maintainer of this library.