When setting up login for users with SMS security enabled, I'm getting a 'User not found' exception.
import boto3
from pycognito import Cognito, MFAChallengeException
from pycognito.aws_srp import AWSSRP
def login(self):
client = boto3.client('cognito-idp', self.region_name)
aws = Cognito(self.pool_id, self.app_client_id, username=self.email)
try:
response = aws.authenticate(password=password)
except MFAChallengeException as mfa:
# I print the exception body; it includes a session and correct challenge parameters, and I am receiving the text code
sms_code = input('Please check your text messages and enter the security code:') # verified to be the correct input string
aws.respond_to_sms_mfa_challenge(sms_code) # done this with and without the mfa.get_tokens() value; same error
My error: botocore.errorfactory.UserNotFoundException: An error occurred (UserNotFoundException) when calling the RespondToAuthChallenge operation: User does not exist.
I've verified the SMS code / username combo elsewhere, so it's specific to this use case.
When setting up login for users with SMS security enabled, I'm getting a 'User not found' exception.
My error:
botocore.errorfactory.UserNotFoundException: An error occurred (UserNotFoundException) when calling the RespondToAuthChallenge operation: User does not exist.
I've verified the SMS code / username combo elsewhere, so it's specific to this use case.