Giter Site home page Giter Site logo

Comments (7)

NikaHsn avatar NikaHsn commented on June 10, 2024

@JorgeAndresDiazz thanks for taking the time to raise this issue. we will look into this and get back to you.

from amplify-flutter.

JorgeAndresDiazz avatar JorgeAndresDiazz commented on June 10, 2024

Thank you @NikaHsn. For additional information, please take into account that the exception occurs even though
new password request (2nd custom challenge "NEW_PASSWORD_REQUIRED") is requested first (before OTP CUSTOM CHALLENGE). I mean, if the following code is the only challenge the login flow has:

// NEW PASSWORD REQUIRED
      final isSetNewPassword = otpChallengeResult.nextStep.signInStep ==
          AuthSignInStep.confirmSignInWithNewPassword;
      if (isSetNewPassword) {
        const newPassword = 'abc1234'; // This is gotten from the user

        final newPasswordResult = await Amplify.Auth.confirmSignIn(
          confirmationValue: newPassword,
        );

I still get the same exception (NotAuthorizedServiceException "message": "Invalid session provided for the user.") when calling await Amplify.Auth.confirmSignIn.

I could replicate the same issue after using Amplify Authenticator package as well (https://ui.docs.amplify.aws/flutter/connected-components/authenticator ). I evaluated AuthenticatorStep.confirmSignInNewPassword and called state.confirmSignInNewPassword() method, which threw the exception

from amplify-flutter.

NikaHsn avatar NikaHsn commented on June 10, 2024

@JorgeAndresDiazz thank you for providing these details. we will look into this issue and get back to you with any updates.

from amplify-flutter.

JorgeAndresDiazz avatar JorgeAndresDiazz commented on June 10, 2024

Hi @NikaHsn. Do we have any news regarding this issue?

from amplify-flutter.

Jordan-Nelson avatar Jordan-Nelson commented on June 10, 2024

Hi @JorgeAndresDiazz - I believe in response to AuthSignInStep.confirmSignInWithNewPassword you should invoke Amplify.Auth.confirmResetPassword() with the confirmation code that was sent to the user along with the new password and username.

I think this is a mistake in the documentation. Can you try Amplify.Auth.confirmResetPassword() and let me know if you face any issues?

from amplify-flutter.

JorgeAndresDiazz avatar JorgeAndresDiazz commented on June 10, 2024

Hey @Jordan-Nelson, thank you for replying

It's not possible to use Amplify.Auth.confirmResetPassword(...) since it expects a required String confirmationCode, which it's a value we don't have. Please take into account that for the OTP custom challenge (previous challenge from AuthSignInStep.confirmSignInWithNewPassword) we use a custom OTP generator in our lambda trigger, which I think does not relate to the confirmationCode expected by the Amplitude SDK

from amplify-flutter.

Jordan-Nelson avatar Jordan-Nelson commented on June 10, 2024

@JorgeAndresDiazz Thanks for the additional info. In the SRP sign in flow Cognito will send a confirmation code which the end user can input for use in confirmResetPassword(). This may not be the case with custom auth. I have reached out to Cognito to see what the expected response should be when using custom auth. I will let you know what I find.

from amplify-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.