'In AWS Cognito, is it possible for an external provider login to setup MFA?

I have setup two factor authentication with the aws-amplify javascript library. With users who sign up with a simple email and password, it works great. I do something like

const user = await Auth.signIn(username, password);

 if (user.challengeName === 'SMS_MFA') ...

However, when a user signs in with an external provider (let's say Google for example) and they enable MFA, the challengeName returned is not SMS_MFA. It comes back as USER_SRP_AUTH.

I'm wondering if I'm not doing something right, or if you just can't setup MFA for external provider logins for some reason? I've looked everywhere for the answer to this question and can't seem to find anything. Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source