furaiev / amazon-cognito-identity-dart-2

Unofficial Amazon Cognito Identity Provider Dart SDK, to easily add user sign-up and sign-in to your mobile and web apps with AWS.
MIT License
181 stars 113 forks source link

"Missing required parameter Session" while MFA is required #253

Closed dhara-seaflux closed 2 months ago

dhara-seaflux commented 5 months ago

When attempting to authenticate the user in my app, I encountered a CognitoUserMfaRequiredException, indicating that MFA is required for my user pool. Upon receiving this exception, I attempted to send the OTP using the sendMFACode function, but encountered the following error:

flutter: CognitoUserException: "SMS_MFA" flutter: MFA is required: CognitoUserException: "SMS_MFA" flutter: CognitoClientException{statusCode: 400, code: InvalidParameterException, name: InvalidParameterException, message: Missing required parameter Session}

miavorac commented 5 months ago

I have the same issue. Upon sending valid credentials, the session is always null so any attempt for TOTP or SMS_MFA fails.

furaiev commented 4 months ago

please check if you have session here: https://github.com/furaiev/amazon-cognito-identity-dart-2/blob/main/lib/src/cognito_user.dart#L931

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

BennyM88 commented 2 months ago

Have you been able to fix it somehow? @dhara-seaflux @miavorac

miavorac commented 1 month ago

Hi, sorry for late reply but yes. It works now!

I didn't know that I need to call sendMFACode for 2FA auth. So all good now.

Thank you 🙏