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

The sendCustomChallengeAnswer (javascript) does not work in flutter with ConfirmSingIn (flutter) #1369

Closed
juanrequeijo opened this issue Feb 17, 2022 · 3 comments
Labels
auth Issues related to the Auth Category

Comments

@juanrequeijo
Copy link

Describe the bug
My login sends a custom OTP code to the user's email to confirm ownership of the email. Using the javascript lib function sendCustomChallengeAnswer the user sends the OTP code he received in the email. In flutter, the equivalent function confirmSingIn shows the following error:

underlyingException:"java.lang.IllegalStateException: confirmSignIn called after signIn has succeeded"

Six months ago the lib didn't support this custom flow:
#276

Still not working?

To Reproduce
Steps to reproduce the behavior:
0. Define a Custom auth challenge:
https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-create-auth-challenge.html

  1. Call:
    await Amplify.Auth.signIn(
    username: emailController.text, password: passwordController.text);
  2. Call:
    Amplify.Auth.confirmSignIn(
    confirmationValue: confirmController.text);

Expected behavior
The functions return with the tokens and the user's complete session logged in:
await Amplify.Auth.fetchAuthSession();
await Amplify.Auth.getCurrentUser();

Platform
x Android

Output of flutter doctor -v
flutter doctor -v
[√] Flutter (Channel stable, 2.10.1, on Microsoft Windows [Version 10.0.19042.1466], locale en-US)
  • Flutter version 2.10.1 at C:\flutter\flutter
  • Upstream repository https://github.com/flutter/flutter.git
  • Framework revision db747aa133 (8 days ago), 2022-02-09 13:57:35 -0600
  • Engine revision ab46186b24
  • Dart version 2.16.1
  • DevTools version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
  • Android SDK at C:\Users\requeiju\AppData\Local\Android\sdk
  • Platform android-32, build-tools 32.1.0-rc1
  • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
  • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
  • All Android licenses accepted.

[√] Android Studio (version 4.1)
  • Android Studio at C:\Program Files\Android\Android Studio
  • Flutter plugin can be installed from:
     https://plugins.jetbrains.com/plugin/9212-flutter
  • Dart plugin can be installed from:
     https://plugins.jetbrains.com/plugin/6351-dart
  • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
Dependencies (pubspec.lock)
dependencies:
flutter:
  sdk: flutter
amplify_flutter: ^0.3.2
amplify_auth_cognito: ^0.3.2
cupertino_icons: ^1.0.2
@haverchuck haverchuck added the auth Issues related to the Auth Category label Feb 17, 2022
@haverchuck
Copy link
Contributor

@juanrequeijo We have discussed this as a team, and we are going to prioritize adding this functionality.

@arunwij
Copy link

arunwij commented Mar 3, 2022

Thank you for working on this. May I know a possible time frame when this feature available in amplify flutter sdk? This would be helpful for me to decide my project's authentication flow.

@dnys1
Copy link
Contributor

dnys1 commented Mar 3, 2022

Since this is part of the custom auth feature, I'm closing this in favor of #410. Please follow that ticket for the latest info including release timelines and notifications.

@dnys1 dnys1 closed this as completed Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues related to the Auth Category
Projects
None yet
Development

No branches or pull requests

4 participants