rahulpsd18 / cognito-backup-restore

AIO Tool for backing up and restoring AWS Cognito User Pools
MIT License
196 stars 63 forks source link

Allow login with Multi Factor Auth (MFA) on the command line #22

Open justhamade opened 4 years ago

justhamade commented 4 years ago

I am not able to use the command line tool because my account assumes a role and uses MFA.

It is possible to allow MFA like so

const token = '123456'
const profile = 'profile'
  const credentials = new AWS.SharedIniFileCredentials({
    profile,
    tokenCodeFn: (mfaSerial, done) => done(null, token),
  })
  AWS.config.credentials = credentials
hauntingEcho commented 3 years ago

MFA is working for me, by authenticating in the CLI and using --use-env-vars