Logout cache issue in auth0-flutter

i’m using auth0-flutter with firebase auth GitHub - auth0/auth0-flutter: Auth0 SDK for Flutter

When I log in, log out, and then log in again, I am logged in immediately without logging in because of the web cache.

So, in the safari settings, press clear browsing history and website data, then return to the app and log in, then log in normally.

sign in

var auth0 = Auth0(Config().auth0Domain, Config().auth0ClientId);
await FirebaseAuth.instance.signInWithProvider(provider);

sign out

await auth0.credentialsManager.clearCredentials(); << i think not working
await FirebaseAuth.instance.signOut();

i’m tried already Authentication API Explorer
and auth0.credentialsManager.clearCredentials()

Hi there @nain93 welcome to the community!

Out of curiosity, do you experience this if your device is set to use a different browser? Are you testing on a physical device or emulator?

I unfortunately do not have a physical iOS device to test with, but I am not experiencing the same issue on the Android side using our sample and a physical device - I’d need to investigate further on the iOS side.

It might be worth checking out our sample app to see if you can reproduce the same issue there:

Let us know!

Thank you for reply @tyf
I’ll upload a case where it doesn’t work as an example project.

After logging out, I want to log in with another auth0, but since it logs in automatically, I need to clear the chrome cache and log in again.

The example was run on an Android emulator.

example_auth0

1 Like

Hey there @nain93 thanks for testing!

I’m still unable to reproduce what you are seeing - I’ve tested both on a physical device (Pixel 5a API 33) as well as in the emulator (Pixel 6 API 33) for Android. For iOS I tested using the the simulator (iPhone 14 Pro iOS 16.2).

Are you integrating Firebase into the sample at all or running it as is? I’m unfortunately not familiar with using Firebase Auth.

@tyf
As you said, I found that there was no cache problem if I didn’t use firebase and used the auth0.webAuthentication().login() method.
but, I get a not Found error

I have set AUTH0_DOMAIN and AUTH0_CLIENT_ID in env and set callback url.

My test AUTH0_DOMAIN is dev-hafexce35igndtuw.us.auth0.com and callback url is https://dev-hafexce35igndtuw.us.auth0.com/android/com.auth0.sample/callback I set com_auth0_scheme to https and login as auth0.webAuthentication().login()

example2

1 Like

Awesome, thanks for confirming!

Regarding the not found error, please see the following post as more often than not it’s related to the https scheme:

thanks @tyf
but I already saw the answer
I think this is not a callback url problem
Because if I entered the wrong callback url, a mismatch error occurred.
The current situation is because the callback url mismatch error does not appear.
And I think there is no problem with my callback url, so please check it.

And the not found error occurs only on Android.

The strange thing is that when com_auth0_scheme is set to demo, a not found error does not occur, and when set to https, a not found error occurs.

Hey @nain93 thanks for the update!

I believe this is expected behavior, unless using Android App Links - FWIW most SDK users end up just using a custom scheme as opposed to https.

Which Android API is your emulator device on? There’s some discussion around these here: