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

Missing Session UUID with MFA challenge #392

Open
yabab-dev opened this issue Aug 7, 2024 · 0 comments
Open

Missing Session UUID with MFA challenge #392

yabab-dev opened this issue Aug 7, 2024 · 0 comments

Comments

@yabab-dev
Copy link

Hi,

I'm trying to use cognito-local MFA challenge (SMS) with Amplify SDK v2 but got an error when I send the code to cognito:

SignInException: 
			An error occurred during the sign in process. 
			
			This most likely occurred due to:
			1. signIn was not called before confirmSignIn.
			2. signIn threw an exception.
			3. page was refreshed during the sign in flow.

https://github.com/aws-amplify/amplify-js/blob/main/packages/auth/src/providers/cognito/apis/confirmSignIn.ts#L69-L84 (signInSession is undefined at this point)

I tried to find the cause of this issue and it seems that the initiateAuth function does not return the sign in session ID for MFA case. If I put Session variable in verifyMfaChallenge() (like in newPasswordChallenge()) it works:

  return {
    ChallengeName: "SMS_MFA",
    ChallengeParameters: {
      CODE_DELIVERY_DELIVERY_MEDIUM: "SMS",
      CODE_DELIVERY_DESTINATION: deliveryDestination,
      USER_ID_FOR_SRP: user.Username,
    },
    Session: v4(),
  };

https://github.com/jagregory/cognito-local/blob/master/src/targets/initiateAuth.ts#L83-L90

I don't know if this is intentional or an omission ?

Thank you!

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