amplify-flutter icon indicating copy to clipboard operation
amplify-flutter copied to clipboard

Not getting lamda exceptions for social login

Open Sunsiha opened this issue 3 years ago • 14 comments

When I tried to call social login we are doing few lamda functions. But in flutter am not able to catch the lamba exceptions for social login. When I tried to login with social auth providers getting error like this;

social loginAuthException(message: Sign-in with web UI failed, recoverySuggestion: See attached exception for more details, underlyingException: com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthServiceException: invalid_request)

Code:

  try {
    var res = await Amplify.Auth.signInWithWebUI(
        provider: authProvider,
        options: const CognitoSignInWithWebUIOptions(
          isPreferPrivateSession: true,
        ));
    print("return response$res");
  } on AuthException catch (e) {
  }

Note: For other cases am getting lamda exceptions in terminal only for social login am not getting. But this lamda errors are getting in web. And we are using same configurations.

They are handling like this;

else if (error.toString().includes("EMAIl_ALREADY_EXISTS")) {
    setErr("Email already exists. Please try again with new one!");
}

Expected Result: Should be able to get the lamda exceptions.

Flutter details:

Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 18116933e7 (3 months ago) • 2021-10-15 10:46:35 -0700
Engine • revision d3ea636dc5
Tools • Dart 2.14.4

Cognito versions:

amplify_flutter: ^0.2.10
amplify_auth_cognito: ^0.2.10

Added the triggers also;

Screenshot 2022-01-19 at 1 02 57 AM Screenshot 2022-01-19 at 1 03 24 AM

Sunsiha avatar Jan 18 '22 19:01 Sunsiha

Hi @Sunsiha - I will try to reproduce. It's possible that this is not supported but I will confirm.

dnys1 avatar Jan 19 '22 16:01 dnys1

Hi @Sunsiha - I will try to reproduce. It's possible that this is not supported but I will confirm.

You mean this exception itself we won't get?

Sunsiha avatar Jan 19 '22 19:01 Sunsiha

Hi @Sunsiha - I was able to reproduce the issue, and only when using social sign in (not with hosted UI or regular sign in/sign up). Would you be willing to create an issue in the amplify-android repo with all the information here? They may have more context as to why this is.

dnys1 avatar Jan 22 '22 01:01 dnys1

Hi @Sunsiha - I was able to reproduce the issue, and only when using social sign in (not with hosted UI or regular sign in/sign up). Would you be willing to create an issue in the amplify-android repo with all the information here? They may have more context as to why this is.

I need a solution. But the same issue is available in iOS also. So again I have to create new issue in amplify-ios also?

Sunsiha avatar Jan 25 '22 17:01 Sunsiha

I'm very sorry - as we depend on these libraries internally, I'm not able to resolve the problem without their assistance. I can create the tickets, if you'd prefer, although for their sake it may be easier if you did since you will be able to troubleshoot and respond to their feedback.

dnys1 avatar Jan 27 '22 19:01 dnys1

I'm very sorry - as we depend on these libraries internally, I'm not able to resolve the problem without their assistance. I can create the tickets, if you'd prefer, although for their sake it may be easier if you did since you will be able to troubleshoot and respond to their feedback.

Please do create a ticket and let me know

Sunsiha avatar Jan 28 '22 04:01 Sunsiha

I've created the issue tickets. Please follow them so that you receive the latest updates.

  • https://github.com/aws-amplify/amplify-android/issues/1649
  • https://github.com/aws-amplify/amplify-ios/issues/1617

dnys1 avatar Feb 01 '22 16:02 dnys1

any update?

Sunsiha avatar Apr 29 '22 20:04 Sunsiha

Hello @Sunsiha - We have recently released a new developer preview version of the Auth category (amplify_flutter v1.0.0-next.0). This new version is a full re-write of the auth category in dart, and it supports Mobile, Desktop, and Web. This issue is addressed in this new version.

You can read more about the developer preview release in the blog post and docs. I will update this issue again once this new version is out of developer preview.

Jordan-Nelson avatar Aug 02 '22 20:08 Jordan-Nelson

Hi @Jordan-Nelson is it supports

Hello @Sunsiha - We have recently released a new developer preview version of the Auth category (amplify_flutter v1.0.0-next.0). This new version is a full re-write of the auth category in dart, and it supports Mobile, Desktop, and Web. This issue is addressed in this new version.

You can read more about the developer preview release in the blog post and docs. I will update this issue again once this new version is out of developer preview.

Is it is supporting web version?

Then why in flutter package it's mentioned only Android and iOS? Screenshot 2022-08-08 at 8 05 43 PM

Sunsiha avatar Aug 08 '22 14:08 Sunsiha

Hi @Sunsiha - Pub did not recognize the first dev preview we released as supporting web. We have released a revision which is recognized by Pub as supporting all platforms. You can see that here.

The original version supported all platforms as well, Pub just didn't recognize as supporting all platforms because it wasn't listed in the pubspec. We have updated that in the latest release.

Jordan-Nelson avatar Aug 08 '22 22:08 Jordan-Nelson

Hi @Sunsiha - Pub did not recognize the first dev preview we released as supporting web. We have released a revision which is recognized by Pub as supporting all platforms. You can see that here.

The original version supported all platforms as well, Pub just didn't recognize as supporting all platforms because it wasn't listed in the pubspec. We have updated that in the latest release.

When this fix will release for amplify_android . for fluter it was released on feb 24 2022 but no response for android. I'm facing this issue on Android. I have created an issue https://github.com/aws-amplify/amplify-android/issues/1907

AsitDixit avatar Aug 29 '22 05:08 AsitDixit

Hello @AsitDixit - Are you using the Amplify-Android libraries, or the Amplify-Flutter libraries targeting flutter? I don't have an ETA on a fix for Amplify-Android. That issue would be the correct place to ask for an update for Amplify-Android.

Jordan-Nelson avatar Aug 29 '22 16:08 Jordan-Nelson

This issue has been addressed in v1.0.0 of Amplify Flutter, which is now stable. This release also includes web and desktop support for Auth, API, Analytics, and Storage. You can see the list of new features and bug fixes in the release notes, and see more details on how to migrate in the upgrade guide.

Jordan-Nelson avatar Apr 17 '23 18:04 Jordan-Nelson