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
187 stars 114 forks source link

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

Closed dhara-seaflux closed 5 months ago

dhara-seaflux commented 8 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 8 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 7 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 6 months ago

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

github-actions[bot] commented 5 months ago

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

BennyM88 commented 5 months ago

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

miavorac commented 4 months 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 🙏