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

Android error: a0.authentication_canceled: The user closed the browser app and the authentication was canceled. #461

Open
6 tasks done
fbernaly opened this issue Jun 6, 2024 · 1 comment

Comments

@fbernaly
Copy link

fbernaly commented Jun 6, 2024

Checklist

Description

I clone this repo to play with the example app and follow the steps to use my domain and client id. I renamed .env.example to .env and filled with my values. Same for strings.xml.example to strings.xml and replace with my values. I edited the example app L54 and L83, with these code:

// L54
final result = await auth0.webAuthentication().login(
        redirectUrl: '<my_package_id>://login-callback',
        useEphemeralSession: true,
);

// L83
await auth0.webAuthentication().logout(
            returnTo: '<my_package_id>://logout-callback');

and run the app in both iOS and Android. It works on iOS, after tapping on Web Auth Login button, I can see the web page, enter my email and password and tap Log In, then I can see the idToken printed in the Flutter app. But when I run the same code on Android (both simulator or actual device) I always see the web page being dismissed automatically without user interaction and this is the error :

a0.authentication_canceled: The user closed the browser app and the authentication was canceled.

How can I fix that code? What am I missing to configure in Android to make it work?

Reproduction

  1. clone repo
  2. edit env file with your values
  3. edit strings.xml with your values
  4. edit webAuthLogin() method L54 with:
final result = await auth0.webAuthentication().login(
        redirectUrl: '<my_package_id>://login-callback',
        useEphemeralSession: true,
);
  1. edit webAuthLogout() method L83 with:
await auth0.webAuthentication().logout(
            returnTo: '<my_package_id>://logout-callback');
  1. run the app on iOS, tap on 'Web Auth Login', you will be able to log in and the idToken will be printed in the Flutter app.
  2. run the app on Android, tap on 'Web Auth Login',, you will see the web being launched and dismissed automatically without user interaction. And error is
a0.authentication_canceled: The user closed the browser app and the authentication was canceled.

Additional context

No response

auth0_flutter version

auth0_flutter

Flutter version

3.19.3

Platform

Android, iOS

Platform version(s)

No response

@fbernaly
Copy link
Author

fbernaly commented Jun 6, 2024

This is a video of what I am seeing:

Screen.Recording.2024-06-05.at.5.50.41.PM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant