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

No implementation found for method webAuth#login on channel auth0.com/auth0_flutter/web_auth #259

Closed
6 tasks done
ivantrave opened this issue May 19, 2023 · 5 comments
Closed
6 tasks done
Labels
cannot-reproduce Cannot reproduce this issue or no repro was provided more info needed This issue is waiting for more information in order to progress

Comments

@ivantrave
Copy link

Checklist

  • The issue can be reproduced in the auth0_flutter sample app (or N/A).
  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

I am currently using Flutter with the following versions:

Flutter 3.7.12 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 4d9e56e694 (4 weeks ago) • 2023-04-17 21:47:46 -0400
Engine • revision 1a65d409c7
Tools • Dart 2.19.6 • DevTools 2.20.1

And using the package auth0_flutter: ^1.1.0.

I followed the installation and configured both, iOS and Android to be able to login/logout users in my app.

For iOS it works like a charm but it does not work in Android (tested in emulators)

I am getting the following error after calling the login function:

Auth0 api = Auth0(<domain>, <myClientId>);

Future<Credentials> login() async {
  return await api.webAuthentication().login();
}
Exception: No implementation found for method webAuth#login on channel auth0.com/auth0_flutter/web_auth

I configured the auth0 allowed callback/logout URLs (notice I used https schema es suggested in the docs for Android) as following:

<myBundleId>://<domain>/ios/<myBundleId>/callback, https://<domain>/android/<myAppId>/callback

And updated the android/app/src/build.gradle file with the suggested configuration:

defaultConfig {
        applicationId "<myAppId>"
        ...
        minSdkVersion 21 // <--- min sdk version needed by auth0 package
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName

        manifestPlaceholders += [auth0Domain: "<domain>", auth0Scheme: "https"] // <--
    }

What am I missing here?

I would appreciate any help.

Many thanks.

PS: Official package documentation (https://pub.dev/packages/auth0_flutter) states that the manifestPlaceholders should be defined as following:

manifestPlaceholders = [auth0Domain: "company.us.auth0.com", auth0Scheme: "https"]

But that generates the following error:

Attribute application@name at AndroidManifest.xml:5:9-42 requires a placeholder substitution but no value for <applicationName> is provided.

since it is overwriting instead of just appending the auth0 properties. That is why I used the += instead

PS 2: Downgrading to version 1.0.2 works for both, Android and iOS

Reproduction

  1. Install specified versions (flutter and auth0_flutter packages)
  2. Run app in Android device (tested in emulator)
  3. Try to login

auth0_flutter version

1.1.0

Flutter version

3.7.12

Platform

Android

Platform version(s)

minSdk 21

@Widcket
Copy link
Collaborator

Widcket commented May 22, 2023

Hi @ivantrave, thanks for raising this. @poovamraj could you please take a look?

@khomin
Copy link

khomin commented May 23, 2023

Oh
Wish I had read this before trying
Seems like $25/month for nothing is not enough to provide even a very primitive web example

@stevehobbsdev
Copy link
Collaborator

Thanks for raising @ivantrave - you confirmed in your issue that you were able to reproduce this in the Flutter sample app but it's working ok for me with no changes other than Auth0 tenant configuration (see video below running in an Android emulator). This sample uses webAuthentication().login() as you are doing (source).

Screen.Recording.2023-05-25.at.13.14.57.mov

If you're able to provide a small reproducible sample that demonstrates the issue, I can take a look.

Thanks for the feedback on the manifest placeholders, I'll get that change made where appropriate.

@stevehobbsdev stevehobbsdev added cannot-reproduce Cannot reproduce this issue or no repro was provided more info needed This issue is waiting for more information in order to progress labels May 25, 2023
@Widcket
Copy link
Collaborator

Widcket commented Jun 5, 2023

Closing due to inactivity. Please feel free to ping if you'd prefer to reopen.

@Widcket Widcket closed this as completed Jun 5, 2023
@auto-eric
Copy link

I have the same problem. I checked out the example, put my clientID and the domain in the .env file. then flutter run -d linux. There is no configuration as for Android or iOS. Is there something I need to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cannot-reproduce Cannot reproduce this issue or no repro was provided more info needed This issue is waiting for more information in order to progress
Projects
None yet
Development

No branches or pull requests

6 participants